UNPKG

762 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.chooseNiceTimeMask = void 0;
4function chooseNiceTimeMask(date, intervalMap) {
5 const { second, minute, hour, day, week, month, year } = intervalMap;
6 if (second.floor(date) < date)
7 return '.SSS';
8 if (minute.floor(date) < date)
9 return ':ss';
10 if (hour.floor(date) < date)
11 return 'hh:mm';
12 if (day.floor(date) < date)
13 return 'hh A';
14 if (month.floor(date) < date) {
15 if (week.floor(date) < date)
16 return 'MMM DD';
17 return 'ddd DD';
18 }
19 if (year.floor(date) < date)
20 return 'MMMM';
21 return 'YYYY';
22}
23exports.chooseNiceTimeMask = chooseNiceTimeMask;
24//# sourceMappingURL=choose-mask.js.map
\No newline at end of file