UNPKG

2.69 kBJavaScriptView Raw
1//! moment.js
2//! version : 2.29.4
3//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4//! license : MIT
5//! momentjs.com
6
7import { hooks as moment, setHookCallback } from './lib/utils/hooks';
8
9moment.version = '2.29.4';
10
11import {
12 min,
13 max,
14 now,
15 isMoment,
16 momentPrototype as fn,
17 createUTC as utc,
18 createUnix as unix,
19 createLocal as local,
20 createInvalid as invalid,
21 createInZone as parseZone,
22} from './lib/moment/moment';
23
24import { getCalendarFormat } from './lib/moment/calendar';
25
26import {
27 defineLocale,
28 updateLocale,
29 getSetGlobalLocale as locale,
30 getLocale as localeData,
31 listLocales as locales,
32 listMonths as months,
33 listMonthsShort as monthsShort,
34 listWeekdays as weekdays,
35 listWeekdaysMin as weekdaysMin,
36 listWeekdaysShort as weekdaysShort,
37} from './lib/locale/locale';
38
39import {
40 isDuration,
41 createDuration as duration,
42 getSetRelativeTimeRounding as relativeTimeRounding,
43 getSetRelativeTimeThreshold as relativeTimeThreshold,
44} from './lib/duration/duration';
45
46import { normalizeUnits } from './lib/units/units';
47
48import isDate from './lib/utils/is-date';
49
50setHookCallback(local);
51
52moment.fn = fn;
53moment.min = min;
54moment.max = max;
55moment.now = now;
56moment.utc = utc;
57moment.unix = unix;
58moment.months = months;
59moment.isDate = isDate;
60moment.locale = locale;
61moment.invalid = invalid;
62moment.duration = duration;
63moment.isMoment = isMoment;
64moment.weekdays = weekdays;
65moment.parseZone = parseZone;
66moment.localeData = localeData;
67moment.isDuration = isDuration;
68moment.monthsShort = monthsShort;
69moment.weekdaysMin = weekdaysMin;
70moment.defineLocale = defineLocale;
71moment.updateLocale = updateLocale;
72moment.locales = locales;
73moment.weekdaysShort = weekdaysShort;
74moment.normalizeUnits = normalizeUnits;
75moment.relativeTimeRounding = relativeTimeRounding;
76moment.relativeTimeThreshold = relativeTimeThreshold;
77moment.calendarFormat = getCalendarFormat;
78moment.prototype = fn;
79
80// currently HTML5 input type only supports 24-hour formats
81moment.HTML5_FMT = {
82 DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
83 DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
84 DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
85 DATE: 'YYYY-MM-DD', // <input type="date" />
86 TIME: 'HH:mm', // <input type="time" />
87 TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
88 TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
89 WEEK: 'GGGG-[W]WW', // <input type="week" />
90 MONTH: 'YYYY-MM', // <input type="month" />
91};
92
93export default moment;