esday 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +4 -0
- package/chunks/{DXFoLbHM.js → 9Re3Ck2t.js} +1 -2
- package/chunks/{CeKusvtV.js → BfEWL_VC.js} +0 -1
- package/chunks/{oiGWnahC.js → Bk-WlP29.js} +20 -35
- package/chunks/{DuRKUq5K.js → BtFAvcS3.js} +1 -2
- package/chunks/{DE-bYjyv.js → BzQsG1-n.js} +21 -21
- package/chunks/DBmUXISx.d.ts +3 -0
- package/chunks/{DMdr1ZL1.js → DLzmBvJ7.js} +2 -3
- package/chunks/{DIG_UBsE.js → DThHId1s.js} +3 -4
- package/chunks/{BB5OVV-y.d.ts → MfctHIHI.d.ts} +0 -8
- package/chunks/{CStrb5bT.js → RZP9wuxV.js} +8 -10
- package/chunks/{i3oEJgL3.js → SIX-1Rv6.js} +1 -2
- package/index.d.ts +2 -2
- package/index.js +1 -2
- package/locales/af.d.ts +3 -2
- package/locales/af.js +1 -2
- package/locales/am.d.ts +3 -2
- package/locales/am.js +1 -2
- package/locales/ar-dz.d.ts +0 -2
- package/locales/ar-dz.js +1 -2
- package/locales/ar-iq.d.ts +0 -2
- package/locales/ar-iq.js +1 -2
- package/locales/ar-kw.d.ts +0 -2
- package/locales/ar-kw.js +1 -2
- package/locales/ar-ly.d.ts +0 -2
- package/locales/ar-ly.js +1 -2
- package/locales/ar-ma.d.ts +0 -2
- package/locales/ar-ma.js +1 -2
- package/locales/ar-sa.d.ts +0 -2
- package/locales/ar-sa.js +1 -2
- package/locales/ar-tn.d.ts +0 -2
- package/locales/ar-tn.js +1 -2
- package/locales/ar.d.ts +3 -2
- package/locales/ar.js +1 -2
- package/locales/az.d.ts +3 -2
- package/locales/az.js +1 -2
- package/locales/be.d.ts +3 -2
- package/locales/be.js +1 -2
- package/locales/bg.d.ts +3 -2
- package/locales/bg.js +1 -2
- package/locales/bi.d.ts +3 -2
- package/locales/bi.js +1 -2
- package/locales/bm.d.ts +3 -2
- package/locales/bm.js +1 -2
- package/locales/bn-bd.d.ts +0 -2
- package/locales/bn-bd.js +2 -3
- package/locales/bn.d.ts +3 -2
- package/locales/bn.js +1 -2
- package/locales/bo.d.ts +3 -2
- package/locales/bo.js +1 -2
- package/locales/br.d.ts +3 -2
- package/locales/br.js +1 -2
- package/locales/bs.d.ts +3 -2
- package/locales/bs.js +1 -2
- package/locales/ca.d.ts +3 -2
- package/locales/ca.js +4 -5
- package/locales/cs.d.ts +3 -2
- package/locales/cs.js +1 -2
- package/locales/cv.d.ts +3 -2
- package/locales/cv.js +1 -2
- package/locales/cy.d.ts +3 -2
- package/locales/cy.js +1 -2
- package/locales/da.d.ts +3 -2
- package/locales/da.js +1 -2
- package/locales/de-at.d.ts +0 -2
- package/locales/de-at.js +2 -3
- package/locales/de-ch.d.ts +0 -2
- package/locales/de-ch.js +2 -3
- package/locales/de.d.ts +3 -2
- package/locales/de.js +1 -2
- package/locales/dv.d.ts +3 -2
- package/locales/dv.js +1 -2
- package/locales/el.d.ts +3 -2
- package/locales/el.js +1 -2
- package/locales/en-au.d.ts +0 -2
- package/locales/en-au.js +1 -2
- package/locales/en-ca.d.ts +0 -2
- package/locales/en-ca.js +1 -2
- package/locales/en-gb.d.ts +0 -2
- package/locales/en-gb.js +1 -2
- package/locales/en-ie.d.ts +0 -2
- package/locales/en-ie.js +1 -2
- package/locales/en-il.d.ts +0 -2
- package/locales/en-il.js +1 -2
- package/locales/en-in.d.ts +0 -2
- package/locales/en-in.js +1 -2
- package/locales/en-nz.d.ts +0 -2
- package/locales/en-nz.js +1 -2
- package/locales/en-sg.d.ts +0 -2
- package/locales/en-sg.js +1 -2
- package/locales/en-tt.d.ts +0 -2
- package/locales/en-tt.js +1 -2
- package/locales/en-us.d.ts +0 -2
- package/locales/en-us.js +1 -2
- package/locales/en.d.ts +4 -2
- package/locales/en.js +1 -2
- package/locales/eo.d.ts +3 -2
- package/locales/eo.js +1 -2
- package/locales/es-do.d.ts +0 -2
- package/locales/es-do.js +2 -3
- package/locales/es-mx.d.ts +0 -2
- package/locales/es-mx.js +2 -3
- package/locales/es-pr.d.ts +0 -2
- package/locales/es-pr.js +2 -3
- package/locales/es-us.d.ts +0 -2
- package/locales/es-us.js +2 -3
- package/locales/es.d.ts +3 -2
- package/locales/es.js +1 -2
- package/locales/et.d.ts +3 -2
- package/locales/et.js +1 -2
- package/locales/eu.d.ts +3 -2
- package/locales/eu.js +1 -2
- package/locales/fa.d.ts +3 -2
- package/locales/fa.js +1 -2
- package/locales/fi.d.ts +3 -2
- package/locales/fi.js +1 -2
- package/locales/fil.d.ts +3 -2
- package/locales/fil.js +1 -2
- package/locales/fo.d.ts +3 -2
- package/locales/fo.js +1 -2
- package/locales/fr-ca.d.ts +0 -2
- package/locales/fr-ca.js +2 -3
- package/locales/fr-ch.d.ts +0 -2
- package/locales/fr-ch.js +2 -3
- package/locales/fr.d.ts +3 -2
- package/locales/fr.js +1 -2
- package/locales/fy.d.ts +3 -2
- package/locales/fy.js +1 -2
- package/locales/ga.d.ts +3 -2
- package/locales/ga.js +1 -2
- package/locales/gd.d.ts +3 -2
- package/locales/gd.js +1 -2
- package/locales/gl.d.ts +3 -2
- package/locales/gl.js +1 -2
- package/locales/gom-deva.d.ts +3 -2
- package/locales/gom-deva.js +1 -2
- package/locales/gom-latn.d.ts +3 -2
- package/locales/gom-latn.js +1 -2
- package/locales/gu.d.ts +3 -2
- package/locales/gu.js +1 -2
- package/locales/he.d.ts +3 -2
- package/locales/he.js +1 -2
- package/locales/hi.d.ts +3 -2
- package/locales/hi.js +1 -2
- package/locales/hr.d.ts +3 -2
- package/locales/hr.js +1 -2
- package/locales/ht.d.ts +3 -2
- package/locales/ht.js +1 -2
- package/locales/hu.d.ts +3 -2
- package/locales/hu.js +1 -2
- package/locales/hy-am.d.ts +3 -2
- package/locales/hy-am.js +1 -2
- package/locales/id.d.ts +3 -2
- package/locales/id.js +2 -3
- package/locales/is.d.ts +3 -2
- package/locales/is.js +1 -2
- package/locales/it-ch.d.ts +0 -2
- package/locales/it-ch.js +2 -3
- package/locales/it.d.ts +3 -2
- package/locales/it.js +1 -2
- package/locales/ja.d.ts +6 -2
- package/locales/ja.js +1 -2
- package/locales/jv.d.ts +3 -2
- package/locales/jv.js +1 -2
- package/locales/ka.d.ts +3 -2
- package/locales/ka.js +3 -4
- package/locales/kk.d.ts +3 -2
- package/locales/kk.js +1 -2
- package/locales/km.d.ts +3 -2
- package/locales/km.js +1 -2
- package/locales/kn.d.ts +3 -2
- package/locales/kn.js +1 -2
- package/locales/ko.d.ts +3 -2
- package/locales/ko.js +1 -2
- package/locales/ku.d.ts +3 -2
- package/locales/ku.js +1 -2
- package/locales/ky.d.ts +3 -2
- package/locales/ky.js +1 -2
- package/locales/lb.d.ts +3 -2
- package/locales/lb.js +1 -2
- package/locales/lo.d.ts +3 -2
- package/locales/lo.js +1 -2
- package/locales/lt.d.ts +3 -2
- package/locales/lt.js +1 -2
- package/locales/lv.d.ts +3 -2
- package/locales/lv.js +1 -2
- package/locales/me.d.ts +3 -2
- package/locales/me.js +1 -2
- package/locales/mi.d.ts +0 -2
- package/locales/mi.js +1 -2
- package/locales/mk.d.ts +0 -2
- package/locales/mk.js +1 -2
- package/locales/ml.d.ts +0 -2
- package/locales/ml.js +1 -2
- package/locales/mn.d.ts +0 -2
- package/locales/mn.js +1 -2
- package/locales/mr.d.ts +3 -2
- package/locales/mr.js +3 -8
- package/locales/ms-my.d.ts +0 -2
- package/locales/ms-my.js +2 -3
- package/locales/ms.d.ts +3 -2
- package/locales/ms.js +1 -2
- package/locales/mt.d.ts +3 -2
- package/locales/mt.js +1 -2
- package/locales/my.d.ts +3 -2
- package/locales/my.js +1 -2
- package/locales/nb.d.ts +3 -2
- package/locales/nb.js +1 -2
- package/locales/ne.d.ts +3 -2
- package/locales/ne.js +1 -2
- package/locales/nl-be.d.ts +0 -2
- package/locales/nl-be.js +4 -5
- package/locales/nl.d.ts +3 -2
- package/locales/nl.js +1 -2
- package/locales/nn.d.ts +3 -2
- package/locales/nn.js +1 -2
- package/locales/oc-lnc.d.ts +3 -2
- package/locales/oc-lnc.js +1 -2
- package/locales/pa-in.d.ts +3 -2
- package/locales/pa-in.js +1 -2
- package/locales/pl.d.ts +3 -2
- package/locales/pl.js +2 -3
- package/locales/pt-br.d.ts +0 -2
- package/locales/pt-br.js +2 -3
- package/locales/pt.d.ts +3 -2
- package/locales/pt.js +1 -2
- package/locales/rn.d.ts +3 -2
- package/locales/rn.js +1 -2
- package/locales/ro.d.ts +3 -2
- package/locales/ro.js +1 -2
- package/locales/ru.d.ts +6 -2
- package/locales/ru.js +1 -2
- package/locales/rw.d.ts +3 -2
- package/locales/rw.js +1 -2
- package/locales/sd.d.ts +3 -2
- package/locales/sd.js +1 -2
- package/locales/se.d.ts +3 -2
- package/locales/se.js +1 -2
- package/locales/si.d.ts +3 -2
- package/locales/si.js +1 -2
- package/locales/sk.d.ts +3 -2
- package/locales/sk.js +1 -2
- package/locales/sl.d.ts +3 -2
- package/locales/sl.js +1 -2
- package/locales/sq.d.ts +3 -2
- package/locales/sq.js +1 -2
- package/locales/sr-cyrl.d.ts +0 -2
- package/locales/sr-cyrl.js +2 -3
- package/locales/sr.d.ts +3 -2
- package/locales/sr.js +1 -2
- package/locales/ss.d.ts +3 -2
- package/locales/ss.js +1 -2
- package/locales/sv-fi.d.ts +0 -2
- package/locales/sv-fi.js +2 -3
- package/locales/sv.d.ts +3 -2
- package/locales/sv.js +2 -3
- package/locales/sw.d.ts +3 -2
- package/locales/sw.js +3 -4
- package/locales/ta.d.ts +3 -2
- package/locales/ta.js +1 -2
- package/locales/te.d.ts +3 -2
- package/locales/te.js +1 -2
- package/locales/tet.d.ts +3 -2
- package/locales/tet.js +1 -2
- package/locales/tg.d.ts +3 -2
- package/locales/tg.js +1 -2
- package/locales/th.d.ts +3 -2
- package/locales/th.js +1 -2
- package/locales/tk.d.ts +3 -2
- package/locales/tk.js +1 -2
- package/locales/tl-ph.d.ts +3 -2
- package/locales/tl-ph.js +1 -2
- package/locales/tlh.d.ts +3 -2
- package/locales/tlh.js +1 -2
- package/locales/tr.d.ts +3 -2
- package/locales/tr.js +1 -2
- package/locales/tzl.d.ts +3 -2
- package/locales/tzl.js +1 -2
- package/locales/tzm-latn.d.ts +0 -2
- package/locales/tzm-latn.js +2 -3
- package/locales/tzm.d.ts +3 -2
- package/locales/tzm.js +1 -2
- package/locales/ug-cn.d.ts +3 -2
- package/locales/ug-cn.js +1 -2
- package/locales/uk.d.ts +0 -2
- package/locales/uk.js +2 -3
- package/locales/ur.d.ts +3 -2
- package/locales/ur.js +1 -2
- package/locales/uz-latn.d.ts +0 -2
- package/locales/uz-latn.js +3 -4
- package/locales/uz.d.ts +3 -2
- package/locales/uz.js +1 -2
- package/locales/vi.d.ts +3 -2
- package/locales/vi.js +1 -2
- package/locales/x-pseudo.d.ts +4 -2
- package/locales/x-pseudo.js +1 -2
- package/locales/yo.d.ts +3 -2
- package/locales/yo.js +1 -2
- package/locales/zh-cn.d.ts +0 -2
- package/locales/zh-cn.js +2 -3
- package/locales/zh-hk.d.ts +0 -2
- package/locales/zh-hk.js +2 -3
- package/locales/zh-mo.d.ts +0 -2
- package/locales/zh-mo.js +2 -3
- package/locales/zh-tw.d.ts +0 -2
- package/locales/zh-tw.js +2 -3
- package/locales/zh.d.ts +6 -2
- package/locales/zh.js +1 -2
- package/package.json +21 -21
- package/plugins/advancedFormat/index.d.ts +6 -3
- package/plugins/advancedFormat/index.js +2 -3
- package/plugins/advancedParse/index.d.ts +20 -3
- package/plugins/advancedParse/index.js +6 -8
- package/plugins/calendar/index.d.ts +8 -3
- package/plugins/calendar/index.js +1 -2
- package/plugins/dayOfYear/index.d.ts +1 -3
- package/plugins/dayOfYear/index.js +1 -2
- package/plugins/duration/index.d.ts +14 -8
- package/plugins/duration/index.js +1 -2
- package/plugins/index.d.ts +2 -2
- package/plugins/index.js +3 -3
- package/plugins/isBetween/index.d.ts +1 -3
- package/plugins/isBetween/index.js +2 -3
- package/plugins/isLeapYear/index.d.ts +1 -3
- package/plugins/isLeapYear/index.js +1 -2
- package/plugins/isSameOrAfter/index.d.ts +1 -3
- package/plugins/isSameOrAfter/index.js +1 -2
- package/plugins/isSameOrBefore/index.d.ts +1 -3
- package/plugins/isSameOrBefore/index.js +1 -2
- package/plugins/isToday/index.d.ts +1 -3
- package/plugins/isToday/index.js +2 -3
- package/plugins/isTomorrow/index.d.ts +1 -3
- package/plugins/isTomorrow/index.js +2 -3
- package/plugins/isYesterday/index.d.ts +1 -3
- package/plugins/isYesterday/index.js +2 -3
- package/plugins/isoWeek/index.d.ts +12 -3
- package/plugins/isoWeek/index.js +5 -6
- package/plugins/locale/index.d.ts +30 -21
- package/plugins/locale/index.js +4 -5
- package/plugins/localeData/index.d.ts +9 -3
- package/plugins/localeData/index.js +3 -6
- package/plugins/localizedFormat/index.d.ts +6 -3
- package/plugins/localizedFormat/index.js +3 -4
- package/plugins/localizedParse/index.d.ts +26 -3
- package/plugins/localizedParse/index.js +2 -3
- package/plugins/minMax/index.d.ts +1 -3
- package/plugins/minMax/index.js +2 -3
- package/plugins/objectSupport/index.d.ts +10 -3
- package/plugins/objectSupport/index.js +6 -9
- package/plugins/pluralGetSet/index.d.ts +8 -3
- package/plugins/pluralGetSet/index.js +1 -2
- package/plugins/quarterOfYear/index.d.ts +6 -3
- package/plugins/quarterOfYear/index.js +4 -5
- package/plugins/relativeTime/index.d.ts +22 -8
- package/plugins/relativeTime/index.js +7 -6
- package/plugins/timezone/index.d.ts +17 -3
- package/plugins/timezone/index.js +1 -2
- package/plugins/toArray/index.d.ts +1 -3
- package/plugins/toArray/index.js +1 -2
- package/plugins/toObject/index.d.ts +1 -3
- package/plugins/toObject/index.js +1 -2
- package/plugins/utc/index.d.ts +11 -3
- package/plugins/utc/index.js +8 -9
- package/plugins/week/index.d.ts +12 -3
- package/plugins/week/index.js +6 -7
- package/LICENSE +0 -21
- package/chunks/CBlQG2yl.d.ts +0 -5
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Locale plugin
|
|
3
|
+
*
|
|
4
|
+
* This plugin adds the 'locale' getter and setter and 'localeObject()' to the EsDay class and
|
|
5
|
+
* the 'locale' getter and setter, 'registerLocale', 'unregisterLocale', 'getLocale' and the
|
|
6
|
+
* 'updateLocale' method to the esday factory.
|
|
7
|
+
*
|
|
8
|
+
* esday parameters in '$conf' defined in Locale plugin:
|
|
9
|
+
* localeName the name of the current locale of an EsDay instance
|
|
10
|
+
*
|
|
11
|
+
* The plugin locale must be activated after the plugin advancedParse
|
|
12
|
+
* esday.extend(advancedParsePlugin).extend(localizedParsePlugin).extend(localePlugin)
|
|
13
|
+
*/
|
|
14
|
+
import { s as EsDayPlugin, t as EsDay } from "../../chunks/MfctHIHI.js";
|
|
3
15
|
type ReadonlyTuple<T, N extends number, R extends readonly T[] = []> = R['length'] extends N ? R : ReadonlyTuple<T, N, readonly [T, ...R]>;
|
|
4
16
|
declare module 'esday' {
|
|
5
17
|
interface EsDay {
|
|
@@ -19,27 +31,27 @@ declare module 'esday' {
|
|
|
19
31
|
localeName?: string;
|
|
20
32
|
}
|
|
21
33
|
}
|
|
22
|
-
type DayNames<T = string> = ReadonlyTuple<T, 7>;
|
|
23
|
-
interface DayNamesStandaloneFormat<T = DayNames<string>> {
|
|
34
|
+
export type DayNames<T = string> = ReadonlyTuple<T, 7>;
|
|
35
|
+
export interface DayNamesStandaloneFormat<T = DayNames<string>> {
|
|
24
36
|
format: T;
|
|
25
37
|
standalone: T;
|
|
26
38
|
isFormat: RegExp;
|
|
27
39
|
}
|
|
28
|
-
type MonthNames<T = string> = ReadonlyTuple<T, 12>;
|
|
29
|
-
interface MonthNamesStandaloneFormat<T = MonthNames<string>> {
|
|
40
|
+
export type MonthNames<T = string> = ReadonlyTuple<T, 12>;
|
|
41
|
+
export interface MonthNamesStandaloneFormat<T = MonthNames<string>> {
|
|
30
42
|
format: T;
|
|
31
43
|
standalone: T;
|
|
32
44
|
isFormat?: RegExp;
|
|
33
45
|
}
|
|
34
|
-
interface MonthNamesFunction<T = MonthNames<string>> {
|
|
46
|
+
export interface MonthNamesFunction<T = MonthNames<string>> {
|
|
35
47
|
(esdayInstance: EsDay, format: string): string;
|
|
36
48
|
format: T;
|
|
37
49
|
standalone: T;
|
|
38
50
|
}
|
|
39
|
-
type LocaleFormatKeys = 'LT' | 'LTS' | 'L' | 'LL' | 'LLL' | 'LLLL' | 'l' | 'll' | 'lll' | 'llll';
|
|
40
|
-
type CalendarSpecValFunction = (this: EsDay, refDate?: EsDay) => string;
|
|
41
|
-
type CalendarSpecVal = string | CalendarSpecValFunction;
|
|
42
|
-
interface Calendar {
|
|
51
|
+
export type LocaleFormatKeys = 'LT' | 'LTS' | 'L' | 'LL' | 'LLL' | 'LLLL' | 'l' | 'll' | 'lll' | 'llll';
|
|
52
|
+
export type CalendarSpecValFunction = (this: EsDay, refDate?: EsDay) => string;
|
|
53
|
+
export type CalendarSpecVal = string | CalendarSpecValFunction;
|
|
54
|
+
export interface Calendar {
|
|
43
55
|
sameDay: CalendarSpecVal;
|
|
44
56
|
nextDay: CalendarSpecVal;
|
|
45
57
|
nextWeek: CalendarSpecVal;
|
|
@@ -47,10 +59,10 @@ interface Calendar {
|
|
|
47
59
|
lastWeek: CalendarSpecVal;
|
|
48
60
|
sameElse: CalendarSpecVal;
|
|
49
61
|
}
|
|
50
|
-
type CalendarPartial = Partial<Calendar>;
|
|
51
|
-
type RelativeTimeKeys = 'future' | 'past' | 's' | 'ss' | 'm' | 'mm' | 'h' | 'hh' | 'd' | 'dd' | 'w' | 'ww' | 'M' | 'MM' | 'y' | 'yy';
|
|
52
|
-
type RelativeTimeElementFunction = (timeValue: string | number, withoutSuffix: boolean, token: RelativeTimeKeys, isFuture: boolean) => string;
|
|
53
|
-
interface Locale {
|
|
62
|
+
export type CalendarPartial = Partial<Calendar>;
|
|
63
|
+
export type RelativeTimeKeys = 'future' | 'past' | 's' | 'ss' | 'm' | 'mm' | 'h' | 'hh' | 'd' | 'dd' | 'w' | 'ww' | 'M' | 'MM' | 'y' | 'yy';
|
|
64
|
+
export type RelativeTimeElementFunction = (timeValue: string | number, withoutSuffix: boolean, token: RelativeTimeKeys, isFuture: boolean) => string;
|
|
65
|
+
export interface Locale {
|
|
54
66
|
/**
|
|
55
67
|
* Name of the locale
|
|
56
68
|
*/
|
|
@@ -83,15 +95,13 @@ interface Locale {
|
|
|
83
95
|
readonly preParse?: (dateString: string) => string;
|
|
84
96
|
readonly postFormat?: (formattedDate: string) => string;
|
|
85
97
|
}
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/plugins/locale/index.d.ts
|
|
88
98
|
/**
|
|
89
99
|
* Set a property in a literal object avoiding a typescript error TS2322.
|
|
90
100
|
* @param targetLocale - object whose property to create or set
|
|
91
101
|
* @param propName - name of the property to create or set
|
|
92
102
|
* @param newValue - new value of the property
|
|
93
103
|
*/
|
|
94
|
-
declare function setLocaleProperty(targetLocale: Locale, propName: string, newValue: any): void;
|
|
104
|
+
export declare function setLocaleProperty(targetLocale: Locale, propName: string, newValue: any): void;
|
|
95
105
|
/**
|
|
96
106
|
* Clone a Locale. Used to create a locale for a territory based
|
|
97
107
|
* on the locale of the corresponding language.
|
|
@@ -100,7 +110,6 @@ declare function setLocaleProperty(targetLocale: Locale, propName: string, newVa
|
|
|
100
110
|
* @param source - locale to clone
|
|
101
111
|
* @returns cloned locale with all all properties set to 'readonly'.
|
|
102
112
|
*/
|
|
103
|
-
declare function cloneLocale(source: Locale): Locale;
|
|
113
|
+
export declare function cloneLocale(source: Locale): Locale;
|
|
104
114
|
declare const localePlugin: EsDayPlugin<{}>;
|
|
105
|
-
|
|
106
|
-
export { Calendar, CalendarPartial, CalendarSpecVal, CalendarSpecValFunction, DayNames, DayNamesStandaloneFormat, Locale, LocaleFormatKeys, MonthNames, MonthNamesFunction, MonthNamesStandaloneFormat, RelativeTimeElementFunction, RelativeTimeKeys, cloneLocale, localePlugin as default, setLocaleProperty };
|
|
115
|
+
export { localePlugin as default };
|
package/plugins/locale/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as constants_default } from "../../chunks/
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { f as constants_default } from "../../chunks/BfEWL_VC.js";
|
|
2
|
+
import { t as normalizeUnit } from "../../chunks/DLzmBvJ7.js";
|
|
3
|
+
import { s as undefinedOr } from "../../chunks/BtFAvcS3.js";
|
|
4
4
|
import localeEn from "../../locales/en.js";
|
|
5
|
-
|
|
5
|
+
// src/plugins/locale/index.ts
|
|
6
6
|
const LocaleStore = /* @__PURE__ */ new Map();
|
|
7
7
|
let $localeGlobal = "en";
|
|
8
8
|
function getLocale(name) {
|
|
@@ -137,5 +137,4 @@ const localePlugin = (_, dayClass, dayFactory) => {
|
|
|
137
137
|
return dayFactory;
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
|
-
//#endregion
|
|
141
140
|
export { cloneLocale, localePlugin as default, setLocaleProperty };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* LocaleData plugin
|
|
3
|
+
*
|
|
4
|
+
* This plugin adds 'method1', 'method2' and formatting and parsing tokens to EsDay
|
|
5
|
+
*
|
|
6
|
+
* This plugin requires the 'Locale' plugin. For using the 'weekdays' function to
|
|
7
|
+
* format a date, the plugin 'Week' is required too.
|
|
8
|
+
*/
|
|
9
|
+
import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
10
|
declare const localeDataPlugin: EsDayPlugin<{}>;
|
|
4
|
-
//#endregion
|
|
5
11
|
export { localeDataPlugin as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as esday } from "../../chunks/
|
|
2
|
-
|
|
1
|
+
import { t as esday } from "../../chunks/Bk-WlP29.js";
|
|
2
|
+
// src/plugins/localeData/index.ts
|
|
3
3
|
/**
|
|
4
4
|
* LocaleData plugin
|
|
5
5
|
*
|
|
@@ -30,9 +30,7 @@ const getWeekdays = (locale, propName, date, format) => {
|
|
|
30
30
|
case "weekdaysShort":
|
|
31
31
|
defaultFormat = "ddd";
|
|
32
32
|
break;
|
|
33
|
-
case "weekdaysMin":
|
|
34
|
-
defaultFormat = "dd";
|
|
35
|
-
break;
|
|
33
|
+
case "weekdaysMin": defaultFormat = "dd";
|
|
36
34
|
}
|
|
37
35
|
if (!Array.isArray(property)) {
|
|
38
36
|
const propAsObject = property;
|
|
@@ -151,5 +149,4 @@ const localeDataPlugin = (_, dayClass, dayFactory) => {
|
|
|
151
149
|
dayFactory.weekdaysShort = () => getWeekdays(dayFactory.getLocale(dayFactory.locale()), "weekdaysShort");
|
|
152
150
|
dayFactory.weekdaysMin = () => getWeekdays(dayFactory.getLocale(dayFactory.locale()), "weekdaysMin");
|
|
153
151
|
};
|
|
154
|
-
//#endregion
|
|
155
152
|
export { localeDataPlugin as default };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* localizedFormat plugin
|
|
3
|
+
*
|
|
4
|
+
* This plugin adds localized formats to advancedFormat plugin and date formatting
|
|
5
|
+
*/
|
|
6
|
+
import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
7
|
declare const localizedFormatPlugin: EsDayPlugin<{}>;
|
|
4
|
-
//#endregion
|
|
5
8
|
export { localizedFormatPlugin as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as isString, t as isArray } from "../../chunks/
|
|
2
|
-
import { t as padNumberWithLeadingZeros } from "../../chunks/
|
|
3
|
-
|
|
1
|
+
import { i as isString, t as isArray } from "../../chunks/BtFAvcS3.js";
|
|
2
|
+
import { t as padNumberWithLeadingZeros } from "../../chunks/9Re3Ck2t.js";
|
|
3
|
+
// src/plugins/localizedFormat/index.ts
|
|
4
4
|
/**
|
|
5
5
|
* Create a function that will format the day of week value from the sourceDate
|
|
6
6
|
* to a day of week string using the given format.
|
|
@@ -77,5 +77,4 @@ const localizedFormatPlugin = (_, dayClass, dayFactory) => {
|
|
|
77
77
|
return this.localeObject?.().postFormat?.(formattedValue) ?? formattedValue;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
|
-
//#endregion
|
|
81
80
|
export { localizedFormatPlugin as default };
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* localizedParse plugin
|
|
3
|
+
*
|
|
4
|
+
* This plugin adds localized parsing formats to the advancedParse plugin.
|
|
5
|
+
*
|
|
6
|
+
* used esday parameters in '$conf':
|
|
7
|
+
* args_1 format parameter in call signature
|
|
8
|
+
* args_2 2nd parameter in call signature
|
|
9
|
+
*
|
|
10
|
+
* esday parameters in '$conf' defined in advancedParse plugin:
|
|
11
|
+
* parseOptions ParseOptions object containing parsing options
|
|
12
|
+
*
|
|
13
|
+
* esday parameters in '$conf' defined in Locale plugin:
|
|
14
|
+
* localeName the name of the current locale of an EsDay instance
|
|
15
|
+
*
|
|
16
|
+
* new esday parameters in '$conf.parseOptions':
|
|
17
|
+
* locale name of the locale to use when parsing
|
|
18
|
+
*
|
|
19
|
+
* This plugin requires the 'advancedParse' plugin, the 'locale' plugin
|
|
20
|
+
* and at least 1 registered locale.
|
|
21
|
+
* When using the locale as a parsing parameter, this locale must be registered too.
|
|
22
|
+
*
|
|
23
|
+
* The plugin localizedParse must be activated after the plugin advancedParse; e.g.
|
|
24
|
+
* esday.extend(advancedParsePlugin).extend(localizedParsePlugin).extend(localePlugin)
|
|
25
|
+
*/
|
|
26
|
+
import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
27
|
declare const localizedParsePlugin: EsDayPlugin<{}>;
|
|
4
|
-
//#endregion
|
|
5
28
|
export { localizedParsePlugin as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as isUndefined, i as isString, t as isArray } from "../../chunks/
|
|
2
|
-
|
|
1
|
+
import { a as isUndefined, i as isString, t as isArray } from "../../chunks/BtFAvcS3.js";
|
|
2
|
+
// src/plugins/localizedParse/index.ts
|
|
3
3
|
const match2 = /\d{2}/;
|
|
4
4
|
const match1to2 = /\d\d?/;
|
|
5
5
|
const matchWord = /\d*[^-_:/,()\s\d]+/;
|
|
@@ -212,5 +212,4 @@ const localizedParsePlugin = (_, dayClass, dayFactory) => {
|
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
214
|
};
|
|
215
|
-
//#endregion
|
|
216
215
|
export { localizedParsePlugin as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { i as DateType, s as EsDayPlugin } from "../../chunks/
|
|
2
|
-
//#region src/plugins/minMax/index.d.ts
|
|
1
|
+
import { i as DateType, s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
2
|
declare module 'esday' {
|
|
4
3
|
interface EsDayFactory {
|
|
5
4
|
max: (...dates: DateType[]) => EsDay;
|
|
@@ -7,5 +6,4 @@ declare module 'esday' {
|
|
|
7
6
|
}
|
|
8
7
|
}
|
|
9
8
|
declare const minMaxPlugin: EsDayPlugin<{}>;
|
|
10
|
-
//#endregion
|
|
11
9
|
export { minMaxPlugin as default };
|
package/plugins/minMax/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as isArray } from "../../chunks/
|
|
2
|
-
|
|
1
|
+
import { t as isArray } from "../../chunks/BtFAvcS3.js";
|
|
2
|
+
// src/plugins/minMax/index.ts
|
|
3
3
|
const minMaxPlugin = (_, _dayClass, dayFactory) => {
|
|
4
4
|
const sortBy = (method, dates) => {
|
|
5
5
|
if (!dates || dates.length === 0 || dates.length === 1 && (!dates[0] || isArray(dates[0]) && dates[0].length === 0)) return dayFactory();
|
|
@@ -15,5 +15,4 @@ const minMaxPlugin = (_, _dayClass, dayFactory) => {
|
|
|
15
15
|
dayFactory.max = (...dates) => sortBy("isAfter", dates);
|
|
16
16
|
dayFactory.min = (...dates) => sortBy("isBefore", dates);
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
export { minMaxPlugin as default };
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ObjectSupport plugin
|
|
3
|
+
*
|
|
4
|
+
* This plugin extends 'esday()', 'esday.utc()', '.set(), '.add() and '.subtract() in EsDay
|
|
5
|
+
* to support an object argument.
|
|
6
|
+
*
|
|
7
|
+
* This will also work when using the plugin Utc. In that case the plugin Utc must be
|
|
8
|
+
* loaded ('extend()') before loading the plugin ObjectSupport.
|
|
9
|
+
*/
|
|
10
|
+
import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
11
|
declare const objectSupportPlugin: EsDayPlugin<{}>;
|
|
4
|
-
//#endregion
|
|
5
12
|
export { objectSupportPlugin as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as constants_default } from "../../chunks/
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { f as constants_default } from "../../chunks/BfEWL_VC.js";
|
|
2
|
+
import { t as createInstanceFromExist } from "../../chunks/SIX-1Rv6.js";
|
|
3
|
+
import { n as isEmptyObject, r as isObject } from "../../chunks/BtFAvcS3.js";
|
|
4
|
+
import { n as normalizeUnitWithPlurals } from "../../chunks/DLzmBvJ7.js";
|
|
5
|
+
// src/plugins/objectSupport/index.ts
|
|
6
6
|
const objectSupportPlugin = (_, dayClass, _dayFactory) => {
|
|
7
7
|
const proto = dayClass.prototype;
|
|
8
8
|
const oldParse = proto["$parse"];
|
|
@@ -42,9 +42,7 @@ const objectSupportPlugin = (_, dayClass, _dayFactory) => {
|
|
|
42
42
|
case constants_default.SECOND:
|
|
43
43
|
dateArrayTuple[5] = Number(date[stringKey]);
|
|
44
44
|
break;
|
|
45
|
-
case constants_default.MS:
|
|
46
|
-
dateArrayTuple[6] = Number(date[stringKey]);
|
|
47
|
-
break;
|
|
45
|
+
case constants_default.MS: dateArrayTuple[6] = Number(date[stringKey]);
|
|
48
46
|
}
|
|
49
47
|
this.$d = this.dateFromDateComponents(...dateArrayTuple);
|
|
50
48
|
} else oldParse.call(this, date);
|
|
@@ -93,5 +91,4 @@ const objectSupportPlugin = (_, dayClass, _dayFactory) => {
|
|
|
93
91
|
return oldSubtract.call(this, value, unit);
|
|
94
92
|
};
|
|
95
93
|
};
|
|
96
|
-
//#endregion
|
|
97
94
|
export { objectSupportPlugin as default };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* PluralGetSet plugin
|
|
3
|
+
*
|
|
4
|
+
* This plugin adds plural getter & setter APIs to EsDay:
|
|
5
|
+
* .milliseconds(), .seconds(), .minutes(), .hours(), .days(),
|
|
6
|
+
* .dates(), .months() and .years()
|
|
7
|
+
*/
|
|
8
|
+
import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
9
|
declare module 'esday' {
|
|
4
10
|
interface EsDay {
|
|
5
11
|
years: (() => number) & ((year: number, month?: number, date?: number) => EsDay);
|
|
@@ -13,5 +19,4 @@ declare module 'esday' {
|
|
|
13
19
|
}
|
|
14
20
|
}
|
|
15
21
|
declare const pluralGetSetPlugin: EsDayPlugin<{}>;
|
|
16
|
-
//#endregion
|
|
17
22
|
export { pluralGetSetPlugin as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/plugins/pluralGetSet/index.ts
|
|
2
2
|
const pluralGetSetPlugin = (_, dayClass, _dayFactory) => {
|
|
3
3
|
const proto = dayClass.prototype;
|
|
4
4
|
proto.years = proto.year;
|
|
@@ -10,5 +10,4 @@ const pluralGetSetPlugin = (_, dayClass, _dayFactory) => {
|
|
|
10
10
|
proto.seconds = proto.second;
|
|
11
11
|
proto.milliseconds = proto.millisecond;
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { pluralGetSetPlugin as default };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* quarterOfYear plugin
|
|
3
|
+
*
|
|
4
|
+
* This plugin adds 'quarter' and the formatting token 'Q' to EsDay.
|
|
5
|
+
*/
|
|
6
|
+
import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
7
|
declare module 'esday' {
|
|
4
8
|
interface EsDay {
|
|
5
9
|
quarter(): number;
|
|
@@ -9,5 +13,4 @@ declare module 'esday' {
|
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
15
|
declare const quarterOfYearPlugin: EsDayPlugin<{}>;
|
|
12
|
-
//#endregion
|
|
13
16
|
export { quarterOfYearPlugin as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { f as constants_default } from "../../chunks/
|
|
2
|
-
import { r as isObject } from "../../chunks/
|
|
3
|
-
import { n as normalizeUnitWithPlurals } from "../../chunks/
|
|
4
|
-
|
|
1
|
+
import { f as constants_default } from "../../chunks/BfEWL_VC.js";
|
|
2
|
+
import { r as isObject } from "../../chunks/BtFAvcS3.js";
|
|
3
|
+
import { n as normalizeUnitWithPlurals } from "../../chunks/DLzmBvJ7.js";
|
|
4
|
+
// src/plugins/quarterOfYear/index.ts
|
|
5
5
|
const quarterOfYearPlugin = (_, dayClass, dayFactory) => {
|
|
6
6
|
const proto = dayClass.prototype;
|
|
7
7
|
proto.quarter = function(quarterNumber) {
|
|
@@ -45,5 +45,4 @@ const quarterOfYearPlugin = (_, dayClass, dayFactory) => {
|
|
|
45
45
|
};
|
|
46
46
|
dayFactory.addFormatTokenDefinitions({ Q: (sourceDate) => sourceDate.quarter().toString() });
|
|
47
47
|
};
|
|
48
|
-
//#endregion
|
|
49
48
|
export { quarterOfYearPlugin as default };
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* RelativeTime adds .from .to .fromNow .toNow APIs to formats date to relative time strings (e.g. 3 hours ago).
|
|
3
|
+
* RelativeTime adds also relativeTimeThreshold and relativeTimeRounding getter / setter
|
|
4
|
+
*
|
|
5
|
+
* Time from now .fromNow(withoutSuffix?: boolean)
|
|
6
|
+
* Returns the string of relative time from now.
|
|
7
|
+
*
|
|
8
|
+
* Time from X .from(compared: Dayjs, withoutSuffix?: boolean)
|
|
9
|
+
* Returns the string of relative time from X.
|
|
10
|
+
*
|
|
11
|
+
* Time to now .toNow(withoutSuffix?: boolean)
|
|
12
|
+
* Returns the string of relative time to now.
|
|
13
|
+
*
|
|
14
|
+
* Time to X .to(compared: Dayjs, withoutSuffix?: boolean)
|
|
15
|
+
* Returns the string of relative time to X.
|
|
16
|
+
*/
|
|
17
|
+
import { i as DateType, s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
2
18
|
import { Locale } from "../locale/index.js";
|
|
3
|
-
//#region src/plugins/relativeTime/index.d.ts
|
|
4
19
|
declare module 'esday' {
|
|
5
20
|
interface EsDay {
|
|
6
21
|
to: (referenceDate: DateType, withoutSuffix?: boolean) => string;
|
|
@@ -18,7 +33,7 @@ declare module 'esday' {
|
|
|
18
33
|
globalThresholds: () => ThresholdRelativeTime;
|
|
19
34
|
}
|
|
20
35
|
}
|
|
21
|
-
type ThresholdRelativeTime = {
|
|
36
|
+
export type ThresholdRelativeTime = {
|
|
22
37
|
ss?: number | null;
|
|
23
38
|
s?: number | null;
|
|
24
39
|
m?: number | null;
|
|
@@ -27,7 +42,7 @@ type ThresholdRelativeTime = {
|
|
|
27
42
|
w?: number | null;
|
|
28
43
|
M?: number | null;
|
|
29
44
|
};
|
|
30
|
-
type DiffAsUnit = {
|
|
45
|
+
export type DiffAsUnit = {
|
|
31
46
|
s: number;
|
|
32
47
|
m: number;
|
|
33
48
|
h: number;
|
|
@@ -36,11 +51,10 @@ type DiffAsUnit = {
|
|
|
36
51
|
M: number;
|
|
37
52
|
y: number;
|
|
38
53
|
};
|
|
39
|
-
type ThresholdRelativeTimeKeys = keyof ThresholdRelativeTime;
|
|
40
|
-
type RelativeTimeRound = (value: number) => number;
|
|
54
|
+
export type ThresholdRelativeTimeKeys = keyof ThresholdRelativeTime;
|
|
55
|
+
export type RelativeTimeRound = (value: number) => number;
|
|
41
56
|
declare const relativeTimePlugin: EsDayPlugin<{
|
|
42
57
|
thresholds?: ThresholdRelativeTime;
|
|
43
58
|
rounding?: (valueToRound: number) => number;
|
|
44
59
|
}>;
|
|
45
|
-
|
|
46
|
-
export { DiffAsUnit, RelativeTimeRound, ThresholdRelativeTime, ThresholdRelativeTimeKeys, relativeTimePlugin as default };
|
|
60
|
+
export { relativeTimePlugin as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as constants_default } from "../../chunks/
|
|
2
|
-
import { t as createInstanceFromExist } from "../../chunks/
|
|
3
|
-
|
|
1
|
+
import { f as constants_default } from "../../chunks/BfEWL_VC.js";
|
|
2
|
+
import { t as createInstanceFromExist } from "../../chunks/SIX-1Rv6.js";
|
|
3
|
+
// src/plugins/relativeTime/index.ts
|
|
4
4
|
const relativeTimePlugin = (options, dayClass, dayFactory) => {
|
|
5
5
|
const defaultRelativeTimeDef = {
|
|
6
6
|
future: "in %s",
|
|
@@ -114,8 +114,10 @@ const relativeTimePlugin = (options, dayClass, dayFactory) => {
|
|
|
114
114
|
if (thresholds[unit] === void 0) return false;
|
|
115
115
|
if (limit === void 0) return thresholds[unit];
|
|
116
116
|
thresholds[unit] = limit;
|
|
117
|
-
if (unit === "s")
|
|
118
|
-
|
|
117
|
+
if (unit === "s") {
|
|
118
|
+
if (limit !== null) thresholds.ss = limit - 1;
|
|
119
|
+
else thresholds.ss = null;
|
|
120
|
+
}
|
|
119
121
|
return true;
|
|
120
122
|
};
|
|
121
123
|
/**
|
|
@@ -181,5 +183,4 @@ const relativeTimePlugin = (options, dayClass, dayFactory) => {
|
|
|
181
183
|
return this.from(now, withoutSuffix);
|
|
182
184
|
};
|
|
183
185
|
};
|
|
184
|
-
//#endregion
|
|
185
186
|
export { relativeTimePlugin as default };
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* timezone plugin
|
|
3
|
+
*
|
|
4
|
+
* This plugin adds the 'tz' method to the EsDay class.
|
|
5
|
+
* This plugin adds the 'tz' method/object to the esday class with the methods 'setDefault', 'getDefault' and 'guess'.
|
|
6
|
+
*
|
|
7
|
+
* This plugin adds the formatting tokens 'z' and 'Z' to EsDay.
|
|
8
|
+
*
|
|
9
|
+
* This plugin requires the 'utc' plugin.
|
|
10
|
+
* When parsing with a locale then the 'advancedParse' plugin, the 'localizedParse' plugin
|
|
11
|
+
* and at least one registered locale.
|
|
12
|
+
* This plugin can handle the 'locale' plugin.
|
|
13
|
+
*
|
|
14
|
+
* esday parameters in '$conf' defined in timezone plugin:
|
|
15
|
+
* timezone name of the timezone of this instance
|
|
16
|
+
*/
|
|
17
|
+
import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
18
|
declare const timezonePLugin: EsDayPlugin<{}>;
|
|
4
|
-
//#endregion
|
|
5
19
|
export { timezonePLugin as default };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { timezonePLugin as default };
|
|
1
|
+
export { t as default } from "../../chunks/RZP9wuxV.js";
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { s as EsDayPlugin } from "../../chunks/
|
|
2
|
-
//#region src/plugins/toArray/index.d.ts
|
|
1
|
+
import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
2
|
declare module 'esday' {
|
|
4
3
|
interface EsDay {
|
|
5
4
|
toArray: () => [number, number, number, number, number, number, number];
|
|
6
5
|
}
|
|
7
6
|
}
|
|
8
7
|
declare const toArrayPlugin: EsDayPlugin<{}>;
|
|
9
|
-
//#endregion
|
|
10
8
|
export { toArrayPlugin as default };
|
package/plugins/toArray/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/plugins/toArray/index.ts
|
|
2
2
|
const toArrayPlugin = (_, dayClass) => {
|
|
3
3
|
dayClass.prototype.toArray = function() {
|
|
4
4
|
return [
|
|
@@ -12,5 +12,4 @@ const toArrayPlugin = (_, dayClass) => {
|
|
|
12
12
|
];
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { toArrayPlugin as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { s as EsDayPlugin } from "../../chunks/
|
|
2
|
-
//#region src/plugins/toObject/index.d.ts
|
|
1
|
+
import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
2
|
declare module 'esday' {
|
|
4
3
|
interface EsDay {
|
|
5
4
|
toObject: () => {
|
|
@@ -14,5 +13,4 @@ declare module 'esday' {
|
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
15
|
declare const toObjectPlugin: EsDayPlugin<{}>;
|
|
17
|
-
//#endregion
|
|
18
16
|
export { toObjectPlugin as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/plugins/toObject/index.ts
|
|
2
2
|
const toObjectPlugin = (_, dayClass) => {
|
|
3
3
|
dayClass.prototype.toObject = function() {
|
|
4
4
|
return {
|
|
@@ -12,5 +12,4 @@ const toObjectPlugin = (_, dayClass) => {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { toObjectPlugin as default };
|
package/plugins/utc/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* utc plugin
|
|
3
|
+
*
|
|
4
|
+
* when utc mode is enabled, get and set methods will use UTC time
|
|
5
|
+
*
|
|
6
|
+
* new esday parameters in '$conf':
|
|
7
|
+
* utc utc mode (true / false)
|
|
8
|
+
* utcOffset utcOffset to use for this esday instance
|
|
9
|
+
* localOffset local timezone offset (as internal Date - $d - is always in local timezone)
|
|
10
|
+
*/
|
|
11
|
+
import { g as SimpleType, i as DateType, s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
12
|
declare module 'esday' {
|
|
4
13
|
interface EsDay {
|
|
5
14
|
utc: (keepLocalTime?: boolean) => EsDay;
|
|
@@ -18,5 +27,4 @@ declare module 'esday' {
|
|
|
18
27
|
}
|
|
19
28
|
}
|
|
20
29
|
declare const utcPlugin: EsDayPlugin<{}>;
|
|
21
|
-
//#endregion
|
|
22
30
|
export { utcPlugin as default };
|
package/plugins/utc/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { f as constants_default } from "../../chunks/
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import { a as
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { f as constants_default } from "../../chunks/BfEWL_VC.js";
|
|
2
|
+
import { t as createInstanceFromExist } from "../../chunks/SIX-1Rv6.js";
|
|
3
|
+
import { a as setUnitInDateUTC, n as getUnitInDateUTC } from "../../chunks/DThHId1s.js";
|
|
4
|
+
import { a as isUndefined, r as isObject } from "../../chunks/BtFAvcS3.js";
|
|
5
|
+
import { n as normalizeUnitWithPlurals } from "../../chunks/DLzmBvJ7.js";
|
|
6
|
+
// src/plugins/utc/index.ts
|
|
7
7
|
const REGEX_VALID_OFFSET_FORMAT = /[+-]\d\d(?::?\d\d)?/g;
|
|
8
8
|
const REGEX_OFFSET_HOURS_MINUTES_FORMAT = /[+-]|\d\d/g;
|
|
9
9
|
function offsetFromString(value = "") {
|
|
@@ -67,8 +67,8 @@ function addUtc(that, value, units) {
|
|
|
67
67
|
case constants_default.SECOND:
|
|
68
68
|
case constants_default.MS: {
|
|
69
69
|
const step = {
|
|
70
|
-
minute:
|
|
71
|
-
hour:
|
|
70
|
+
minute: 6e4,
|
|
71
|
+
hour: 36e5,
|
|
72
72
|
second: 1e3
|
|
73
73
|
}[unit] || 1;
|
|
74
74
|
const nextTimeStamp = $d.getTime() + value * step;
|
|
@@ -186,5 +186,4 @@ const utcPlugin = (_, dayClass, dayFactory) => {
|
|
|
186
186
|
return oldSubtract.call(this, value, unit);
|
|
187
187
|
};
|
|
188
188
|
};
|
|
189
|
-
//#endregion
|
|
190
189
|
export { utcPlugin as default };
|
package/plugins/week/index.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* week plugin
|
|
3
|
+
*
|
|
4
|
+
* This plugin adds 'week', 'weeks', 'weekday', 'weekYear', 'weeksInYear'
|
|
5
|
+
* and week related formatting and parsing tokens to EsDay.
|
|
6
|
+
*
|
|
7
|
+
* This plugin requires the 'locale' plugin and a locale to be loaded.
|
|
8
|
+
* For the 'wo' formatting token, the 'localizedFormat' plugin is required too.
|
|
9
|
+
*
|
|
10
|
+
* To use the parsing tokens, the plugin AdvancedParse is required.
|
|
11
|
+
*/
|
|
12
|
+
import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
|
|
3
13
|
declare module 'esday' {
|
|
4
14
|
interface EsDay {
|
|
5
15
|
week(): number;
|
|
@@ -14,5 +24,4 @@ declare module 'esday' {
|
|
|
14
24
|
}
|
|
15
25
|
}
|
|
16
26
|
declare const weekPlugin: EsDayPlugin<{}>;
|
|
17
|
-
//#endregion
|
|
18
27
|
export { weekPlugin as default };
|