mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 13:09:40 +08:00
13 lines
321 B
JavaScript
13 lines
321 B
JavaScript
import moment from 'moment';
|
|
import MockDate from 'mockdate';
|
|
|
|
export function setMockDate(dateString = '2017-09-18T03:30:07.795') {
|
|
MockDate.set(moment(dateString));
|
|
}
|
|
|
|
export function resetMockDate() {
|
|
MockDate.reset();
|
|
}
|
|
|
|
export const sleep = (timeout = 0) => new Promise(resolve => setTimeout(resolve, timeout));
|