mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
a8a4152c65
Fix #8839
11 lines
286 B
JavaScript
11 lines
286 B
JavaScript
import moment from 'moment';
|
|
import MockDate from 'mockdate';
|
|
|
|
export function setMockDate(dateString = '2017-09-18T03:30:07.795Z') {
|
|
MockDate.set(moment(dateString).valueOf() + (new Date().getTimezoneOffset() * 60 * 1000));
|
|
}
|
|
|
|
export function resetMockDate() {
|
|
MockDate.reset();
|
|
}
|