@revivejs/moment 2.30.2

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.
Files changed (293) hide show
  1. package/CHANGELOG.md +996 -0
  2. package/LICENSE +22 -0
  3. package/README.md +158 -0
  4. package/dist/locale/af.js +71 -0
  5. package/dist/locale/ar-dz.js +156 -0
  6. package/dist/locale/ar-kw.js +55 -0
  7. package/dist/locale/ar-ly.js +171 -0
  8. package/dist/locale/ar-ma.js +56 -0
  9. package/dist/locale/ar-ps.js +112 -0
  10. package/dist/locale/ar-sa.js +105 -0
  11. package/dist/locale/ar-tn.js +55 -0
  12. package/dist/locale/ar.js +189 -0
  13. package/dist/locale/az.js +102 -0
  14. package/dist/locale/be.js +142 -0
  15. package/dist/locale/bg.js +87 -0
  16. package/dist/locale/bm.js +52 -0
  17. package/dist/locale/bn-bd.js +129 -0
  18. package/dist/locale/bn.js +119 -0
  19. package/dist/locale/bo.js +124 -0
  20. package/dist/locale/br.js +168 -0
  21. package/dist/locale/bs.js +160 -0
  22. package/dist/locale/ca.js +100 -0
  23. package/dist/locale/cs.js +181 -0
  24. package/dist/locale/cv.js +63 -0
  25. package/dist/locale/cy.js +98 -0
  26. package/dist/locale/da.js +53 -0
  27. package/dist/locale/de-at.js +79 -0
  28. package/dist/locale/de-ch.js +78 -0
  29. package/dist/locale/de.js +78 -0
  30. package/dist/locale/dv.js +90 -0
  31. package/dist/locale/el.js +106 -0
  32. package/dist/locale/en-au.js +68 -0
  33. package/dist/locale/en-ca.js +64 -0
  34. package/dist/locale/en-gb.js +68 -0
  35. package/dist/locale/en-ie.js +68 -0
  36. package/dist/locale/en-il.js +64 -0
  37. package/dist/locale/en-in.js +68 -0
  38. package/dist/locale/en-nz.js +68 -0
  39. package/dist/locale/en-sg.js +68 -0
  40. package/dist/locale/eo.js +68 -0
  41. package/dist/locale/es-do.js +108 -0
  42. package/dist/locale/es-mx.js +110 -0
  43. package/dist/locale/es-us.js +110 -0
  44. package/dist/locale/es.js +110 -0
  45. package/dist/locale/et.js +78 -0
  46. package/dist/locale/eu.js +65 -0
  47. package/dist/locale/fa.js +113 -0
  48. package/dist/locale/fi.js +124 -0
  49. package/dist/locale/fil.js +58 -0
  50. package/dist/locale/fo.js +57 -0
  51. package/dist/locale/fr-ca.js +70 -0
  52. package/dist/locale/fr-ch.js +74 -0
  53. package/dist/locale/fr.js +108 -0
  54. package/dist/locale/fy.js +75 -0
  55. package/dist/locale/ga.js +95 -0
  56. package/dist/locale/gd.js +95 -0
  57. package/dist/locale/gl.js +75 -0
  58. package/dist/locale/gom-deva.js +126 -0
  59. package/dist/locale/gom-latn.js +124 -0
  60. package/dist/locale/gu.js +122 -0
  61. package/dist/locale/he.js +94 -0
  62. package/dist/locale/hi.js +168 -0
  63. package/dist/locale/hr.js +156 -0
  64. package/dist/locale/hu.js +118 -0
  65. package/dist/locale/hy-am.js +94 -0
  66. package/dist/locale/id.js +76 -0
  67. package/dist/locale/is.js +140 -0
  68. package/dist/locale/it-ch.js +64 -0
  69. package/dist/locale/it.js +106 -0
  70. package/dist/locale/ja.js +148 -0
  71. package/dist/locale/jv.js +76 -0
  72. package/dist/locale/ka.js +92 -0
  73. package/dist/locale/kk.js +82 -0
  74. package/dist/locale/km.js +103 -0
  75. package/dist/locale/kn.js +124 -0
  76. package/dist/locale/ko.js +75 -0
  77. package/dist/locale/ku-kmr.js +121 -0
  78. package/dist/locale/ku.js +118 -0
  79. package/dist/locale/ky.js +84 -0
  80. package/dist/locale/lb.js +137 -0
  81. package/dist/locale/lo.js +66 -0
  82. package/dist/locale/lt.js +125 -0
  83. package/dist/locale/lv.js +94 -0
  84. package/dist/locale/me.js +117 -0
  85. package/dist/locale/mi.js +60 -0
  86. package/dist/locale/mk.js +85 -0
  87. package/dist/locale/ml.js +82 -0
  88. package/dist/locale/mn.js +100 -0
  89. package/dist/locale/mr.js +203 -0
  90. package/dist/locale/ms-my.js +76 -0
  91. package/dist/locale/ms.js +75 -0
  92. package/dist/locale/mt.js +56 -0
  93. package/dist/locale/my.js +91 -0
  94. package/dist/locale/nb.js +60 -0
  95. package/dist/locale/ne.js +121 -0
  96. package/dist/locale/nl-be.js +102 -0
  97. package/dist/locale/nl.js +104 -0
  98. package/dist/locale/nn.js +59 -0
  99. package/dist/locale/oc-lnc.js +85 -0
  100. package/dist/locale/pa-in.js +122 -0
  101. package/dist/locale/pl.js +140 -0
  102. package/dist/locale/pt-br.js +58 -0
  103. package/dist/locale/pt.js +63 -0
  104. package/dist/locale/ro.js +76 -0
  105. package/dist/locale/ru.js +213 -0
  106. package/dist/locale/sd.js +81 -0
  107. package/dist/locale/se.js +57 -0
  108. package/dist/locale/si.js +69 -0
  109. package/dist/locale/sk.js +145 -0
  110. package/dist/locale/sl.js +171 -0
  111. package/dist/locale/sq.js +65 -0
  112. package/dist/locale/sr-cyrl.js +127 -0
  113. package/dist/locale/sr.js +129 -0
  114. package/dist/locale/ss.js +84 -0
  115. package/dist/locale/sv.js +68 -0
  116. package/dist/locale/sw.js +55 -0
  117. package/dist/locale/ta.js +131 -0
  118. package/dist/locale/te.js +88 -0
  119. package/dist/locale/tet.js +68 -0
  120. package/dist/locale/tg.js +117 -0
  121. package/dist/locale/th.js +65 -0
  122. package/dist/locale/tk.js +91 -0
  123. package/dist/locale/tl-ph.js +57 -0
  124. package/dist/locale/tlh.js +124 -0
  125. package/dist/locale/tr.js +106 -0
  126. package/dist/locale/tzl.js +89 -0
  127. package/dist/locale/tzm-latn.js +54 -0
  128. package/dist/locale/tzm.js +54 -0
  129. package/dist/locale/ug-cn.js +111 -0
  130. package/dist/locale/uk.js +167 -0
  131. package/dist/locale/ur.js +82 -0
  132. package/dist/locale/uz-latn.js +54 -0
  133. package/dist/locale/uz.js +51 -0
  134. package/dist/locale/vi.js +80 -0
  135. package/dist/locale/x-pseudo.js +73 -0
  136. package/dist/locale/yo.js +53 -0
  137. package/dist/locale/zh-cn.js +120 -0
  138. package/dist/locale/zh-hk.js +101 -0
  139. package/dist/locale/zh-mo.js +100 -0
  140. package/dist/locale/zh-tw.js +99 -0
  141. package/dist/moment.js +5680 -0
  142. package/ender.js +1 -0
  143. package/locale/af.js +82 -0
  144. package/locale/ar-dz.js +167 -0
  145. package/locale/ar-kw.js +66 -0
  146. package/locale/ar-ly.js +182 -0
  147. package/locale/ar-ma.js +67 -0
  148. package/locale/ar-ps.js +123 -0
  149. package/locale/ar-sa.js +116 -0
  150. package/locale/ar-tn.js +66 -0
  151. package/locale/ar.js +200 -0
  152. package/locale/az.js +113 -0
  153. package/locale/be.js +153 -0
  154. package/locale/bg.js +98 -0
  155. package/locale/bm.js +62 -0
  156. package/locale/bn-bd.js +140 -0
  157. package/locale/bn.js +130 -0
  158. package/locale/bo.js +135 -0
  159. package/locale/br.js +179 -0
  160. package/locale/bs.js +171 -0
  161. package/locale/ca.js +111 -0
  162. package/locale/cs.js +192 -0
  163. package/locale/cv.js +74 -0
  164. package/locale/cy.js +109 -0
  165. package/locale/da.js +64 -0
  166. package/locale/de-at.js +90 -0
  167. package/locale/de-ch.js +87 -0
  168. package/locale/de.js +89 -0
  169. package/locale/dv.js +101 -0
  170. package/locale/el.js +117 -0
  171. package/locale/en-au.js +79 -0
  172. package/locale/en-ca.js +75 -0
  173. package/locale/en-gb.js +79 -0
  174. package/locale/en-ie.js +79 -0
  175. package/locale/en-il.js +75 -0
  176. package/locale/en-in.js +79 -0
  177. package/locale/en-nz.js +79 -0
  178. package/locale/en-sg.js +79 -0
  179. package/locale/eo.js +79 -0
  180. package/locale/es-do.js +119 -0
  181. package/locale/es-mx.js +121 -0
  182. package/locale/es-us.js +121 -0
  183. package/locale/es.js +121 -0
  184. package/locale/et.js +89 -0
  185. package/locale/eu.js +76 -0
  186. package/locale/fa.js +124 -0
  187. package/locale/fi.js +135 -0
  188. package/locale/fil.js +69 -0
  189. package/locale/fo.js +68 -0
  190. package/locale/fr-ca.js +81 -0
  191. package/locale/fr-ch.js +85 -0
  192. package/locale/fr.js +119 -0
  193. package/locale/fy.js +86 -0
  194. package/locale/ga.js +106 -0
  195. package/locale/gd.js +106 -0
  196. package/locale/gl.js +86 -0
  197. package/locale/gom-deva.js +137 -0
  198. package/locale/gom-latn.js +135 -0
  199. package/locale/gu.js +133 -0
  200. package/locale/he.js +105 -0
  201. package/locale/hi.js +179 -0
  202. package/locale/hr.js +167 -0
  203. package/locale/hu.js +129 -0
  204. package/locale/hy-am.js +105 -0
  205. package/locale/id.js +87 -0
  206. package/locale/is.js +151 -0
  207. package/locale/it-ch.js +75 -0
  208. package/locale/it.js +117 -0
  209. package/locale/ja.js +159 -0
  210. package/locale/jv.js +87 -0
  211. package/locale/ka.js +103 -0
  212. package/locale/kk.js +93 -0
  213. package/locale/km.js +114 -0
  214. package/locale/kn.js +135 -0
  215. package/locale/ko.js +86 -0
  216. package/locale/ku-kmr.js +125 -0
  217. package/locale/ku.js +129 -0
  218. package/locale/ky.js +95 -0
  219. package/locale/lb.js +148 -0
  220. package/locale/lo.js +77 -0
  221. package/locale/lt.js +136 -0
  222. package/locale/lv.js +105 -0
  223. package/locale/me.js +128 -0
  224. package/locale/mi.js +71 -0
  225. package/locale/mk.js +97 -0
  226. package/locale/ml.js +93 -0
  227. package/locale/mn.js +111 -0
  228. package/locale/mr.js +214 -0
  229. package/locale/ms-my.js +87 -0
  230. package/locale/ms.js +86 -0
  231. package/locale/mt.js +67 -0
  232. package/locale/my.js +102 -0
  233. package/locale/nb.js +71 -0
  234. package/locale/ne.js +132 -0
  235. package/locale/nl-be.js +113 -0
  236. package/locale/nl.js +115 -0
  237. package/locale/nn.js +70 -0
  238. package/locale/oc-lnc.js +96 -0
  239. package/locale/pa-in.js +133 -0
  240. package/locale/pl.js +151 -0
  241. package/locale/pt-br.js +69 -0
  242. package/locale/pt.js +74 -0
  243. package/locale/ro.js +87 -0
  244. package/locale/ru.js +224 -0
  245. package/locale/sd.js +92 -0
  246. package/locale/se.js +68 -0
  247. package/locale/si.js +80 -0
  248. package/locale/sk.js +156 -0
  249. package/locale/sl.js +182 -0
  250. package/locale/sq.js +76 -0
  251. package/locale/sr-cyrl.js +138 -0
  252. package/locale/sr.js +140 -0
  253. package/locale/ss.js +95 -0
  254. package/locale/sv.js +79 -0
  255. package/locale/sw.js +66 -0
  256. package/locale/ta.js +142 -0
  257. package/locale/te.js +99 -0
  258. package/locale/tet.js +79 -0
  259. package/locale/tg.js +128 -0
  260. package/locale/th.js +76 -0
  261. package/locale/tk.js +102 -0
  262. package/locale/tl-ph.js +68 -0
  263. package/locale/tlh.js +135 -0
  264. package/locale/tr.js +117 -0
  265. package/locale/tzl.js +100 -0
  266. package/locale/tzm-latn.js +65 -0
  267. package/locale/tzm.js +65 -0
  268. package/locale/ug-cn.js +122 -0
  269. package/locale/uk.js +178 -0
  270. package/locale/ur.js +93 -0
  271. package/locale/uz-latn.js +65 -0
  272. package/locale/uz.js +62 -0
  273. package/locale/vi.js +91 -0
  274. package/locale/x-pseudo.js +84 -0
  275. package/locale/yo.js +64 -0
  276. package/locale/zh-cn.js +131 -0
  277. package/locale/zh-hk.js +112 -0
  278. package/locale/zh-mo.js +111 -0
  279. package/locale/zh-tw.js +110 -0
  280. package/min/locales.js +12800 -0
  281. package/min/locales.min.js +2 -0
  282. package/min/locales.min.js.map +1 -0
  283. package/min/moment-with-locales.js +18472 -0
  284. package/min/moment-with-locales.min.js +2 -0
  285. package/min/moment-with-locales.min.js.map +1 -0
  286. package/min/moment.min.js +2 -0
  287. package/min/moment.min.js.map +1 -0
  288. package/min/tests.js +149292 -0
  289. package/moment.d.ts +796 -0
  290. package/moment.js +5688 -0
  291. package/package.js +11 -0
  292. package/package.json +152 -0
  293. package/ts3.1-typings/moment.d.ts +785 -0
package/moment.d.ts ADDED
@@ -0,0 +1,796 @@
1
+ /**
2
+ * @param strict Strict parsing disables the deprecated fallback to the native Date constructor when
3
+ * parsing a string.
4
+ */
5
+ declare function moment(inp?: moment.MomentInput, strict?: boolean): moment.Moment;
6
+ /**
7
+ * @param strict Strict parsing requires that the format and input match exactly, including delimiters.
8
+ * Strict parsing is frequently the best parsing option. For more information about choosing strict vs
9
+ * forgiving parsing, see the [parsing guide](https://momentjs.com/guides/#/parsing/).
10
+ */
11
+ declare function moment(inp?: moment.MomentInput, format?: moment.MomentFormatSpecification, strict?: boolean): moment.Moment;
12
+ /**
13
+ * @param strict Strict parsing requires that the format and input match exactly, including delimiters.
14
+ * Strict parsing is frequently the best parsing option. For more information about choosing strict vs
15
+ * forgiving parsing, see the [parsing guide](https://momentjs.com/guides/#/parsing/).
16
+ */
17
+ declare function moment(inp?: moment.MomentInput, format?: moment.MomentFormatSpecification, language?: string, strict?: boolean): moment.Moment;
18
+
19
+ declare namespace moment {
20
+ type RelativeTimeKey = 's' | 'ss' | 'm' | 'mm' | 'h' | 'hh' | 'd' | 'dd' | 'w' | 'ww' | 'M' | 'MM' | 'y' | 'yy';
21
+ type CalendarKey = 'sameDay' | 'nextDay' | 'lastDay' | 'nextWeek' | 'lastWeek' | 'sameElse' | string;
22
+ type LongDateFormatKey = 'LTS' | 'LT' | 'L' | 'LL' | 'LLL' | 'LLLL' | 'lts' | 'lt' | 'l' | 'll' | 'lll' | 'llll';
23
+
24
+ interface Locale {
25
+ calendar(key?: CalendarKey, m?: Moment, now?: Moment): string;
26
+
27
+ longDateFormat(key: LongDateFormatKey): string;
28
+ invalidDate(): string;
29
+ ordinal(n: number): string;
30
+
31
+ preparse(inp: string): string;
32
+ postformat(inp: string): string;
33
+ relativeTime(n: number, withoutSuffix: boolean,
34
+ key: RelativeTimeKey, isFuture: boolean): string;
35
+ pastFuture(diff: number, absRelTime: string): string;
36
+ set(config: Object): void;
37
+
38
+ months(): string[];
39
+ months(m: Moment, format?: string): string;
40
+ monthsShort(): string[];
41
+ monthsShort(m: Moment, format?: string): string;
42
+ monthsParse(monthName: string, format: string, strict: boolean): number;
43
+ monthsRegex(strict: boolean): RegExp;
44
+ monthsShortRegex(strict: boolean): RegExp;
45
+
46
+ week(m: Moment): number;
47
+ firstDayOfYear(): number;
48
+ firstDayOfWeek(): number;
49
+
50
+ weekdays(): string[];
51
+ weekdays(m: Moment, format?: string): string;
52
+ weekdaysMin(): string[];
53
+ weekdaysMin(m: Moment): string;
54
+ weekdaysShort(): string[];
55
+ weekdaysShort(m: Moment): string;
56
+ weekdaysParse(weekdayName: string, format: string, strict: boolean): number;
57
+ weekdaysRegex(strict: boolean): RegExp;
58
+ weekdaysShortRegex(strict: boolean): RegExp;
59
+ weekdaysMinRegex(strict: boolean): RegExp;
60
+
61
+ isPM(input: string): boolean;
62
+ meridiem(hour: number, minute: number, isLower: boolean): string;
63
+ }
64
+
65
+ interface StandaloneFormatSpec {
66
+ format: string[];
67
+ standalone: string[];
68
+ isFormat?: RegExp;
69
+ }
70
+
71
+ interface WeekSpec {
72
+ dow: number;
73
+ doy?: number;
74
+ }
75
+
76
+ type CalendarSpecVal = string | ((m?: MomentInput, now?: Moment) => string);
77
+ interface CalendarSpec {
78
+ sameDay?: CalendarSpecVal;
79
+ nextDay?: CalendarSpecVal;
80
+ lastDay?: CalendarSpecVal;
81
+ nextWeek?: CalendarSpecVal;
82
+ lastWeek?: CalendarSpecVal;
83
+ sameElse?: CalendarSpecVal;
84
+
85
+ // any additional properties might be used with moment.calendarFormat
86
+ [x: string]: CalendarSpecVal | void; // undefined
87
+ }
88
+
89
+ type RelativeTimeSpecVal = (
90
+ string |
91
+ ((n: number, withoutSuffix: boolean,
92
+ key: RelativeTimeKey, isFuture: boolean) => string)
93
+ );
94
+ type RelativeTimeFuturePastVal = string | ((relTime: string) => string);
95
+
96
+ interface RelativeTimeSpec {
97
+ future?: RelativeTimeFuturePastVal;
98
+ past?: RelativeTimeFuturePastVal;
99
+ s?: RelativeTimeSpecVal;
100
+ ss?: RelativeTimeSpecVal;
101
+ m?: RelativeTimeSpecVal;
102
+ mm?: RelativeTimeSpecVal;
103
+ h?: RelativeTimeSpecVal;
104
+ hh?: RelativeTimeSpecVal;
105
+ d?: RelativeTimeSpecVal;
106
+ dd?: RelativeTimeSpecVal;
107
+ w?: RelativeTimeSpecVal
108
+ ww?: RelativeTimeSpecVal;
109
+ M?: RelativeTimeSpecVal;
110
+ MM?: RelativeTimeSpecVal;
111
+ y?: RelativeTimeSpecVal;
112
+ yy?: RelativeTimeSpecVal;
113
+ }
114
+
115
+ interface LongDateFormatSpec {
116
+ LTS: string;
117
+ LT: string;
118
+ L: string;
119
+ LL: string;
120
+ LLL: string;
121
+ LLLL: string;
122
+
123
+ // lets forget for a sec that any upper/lower permutation will also work
124
+ lts?: string;
125
+ lt?: string;
126
+ l?: string;
127
+ ll?: string;
128
+ lll?: string;
129
+ llll?: string;
130
+ }
131
+
132
+ type MonthWeekdayFn = (momentToFormat: Moment, format?: string) => string;
133
+ type WeekdaySimpleFn = (momentToFormat: Moment) => string;
134
+ interface EraSpec {
135
+ since: string | number;
136
+ until: string | number;
137
+ offset: number;
138
+ name: string;
139
+ narrow: string;
140
+ abbr: string;
141
+ }
142
+
143
+ interface LocaleSpecification {
144
+ months?: string[] | StandaloneFormatSpec | MonthWeekdayFn;
145
+ monthsShort?: string[] | StandaloneFormatSpec | MonthWeekdayFn;
146
+
147
+ weekdays?: string[] | StandaloneFormatSpec | MonthWeekdayFn;
148
+ weekdaysShort?: string[] | StandaloneFormatSpec | WeekdaySimpleFn;
149
+ weekdaysMin?: string[] | StandaloneFormatSpec | WeekdaySimpleFn;
150
+
151
+ meridiemParse?: RegExp;
152
+ meridiem?: (hour: number, minute:number, isLower: boolean) => string;
153
+
154
+ isPM?: (input: string) => boolean;
155
+
156
+ longDateFormat?: LongDateFormatSpec;
157
+ calendar?: CalendarSpec;
158
+ relativeTime?: RelativeTimeSpec;
159
+ invalidDate?: string;
160
+ ordinal?: (n: number) => string;
161
+ ordinalParse?: RegExp;
162
+
163
+ week?: WeekSpec;
164
+ eras?: EraSpec[];
165
+
166
+ // Allow anything: in general any property that is passed as locale spec is
167
+ // put in the locale object so it can be used by locale functions
168
+ [x: string]: any;
169
+ }
170
+
171
+ interface MomentObjectOutput {
172
+ years: number;
173
+ /* One digit */
174
+ months: number;
175
+ /* Day of the month */
176
+ date: number;
177
+ hours: number;
178
+ minutes: number;
179
+ seconds: number;
180
+ milliseconds: number;
181
+ }
182
+
183
+ interface argThresholdOpts {
184
+ ss?: number;
185
+ s?: number;
186
+ m?: number;
187
+ h?: number;
188
+ d?: number;
189
+ w?: number | void;
190
+ M?: number;
191
+ }
192
+
193
+ interface Duration {
194
+ clone(): Duration;
195
+
196
+ humanize(argWithSuffix?: boolean, argThresholds?: argThresholdOpts): string;
197
+
198
+ humanize(argThresholds?: argThresholdOpts): string;
199
+
200
+ abs(): Duration;
201
+
202
+ as(units: unitOfTime.Base): number;
203
+ get(units: unitOfTime.Base): number;
204
+
205
+ milliseconds(): number;
206
+ asMilliseconds(): number;
207
+
208
+ seconds(): number;
209
+ asSeconds(): number;
210
+
211
+ minutes(): number;
212
+ asMinutes(): number;
213
+
214
+ hours(): number;
215
+ asHours(): number;
216
+
217
+ days(): number;
218
+ asDays(): number;
219
+
220
+ weeks(): number;
221
+ asWeeks(): number;
222
+
223
+ months(): number;
224
+ asMonths(): number;
225
+
226
+ years(): number;
227
+ asYears(): number;
228
+
229
+ add(inp?: DurationInputArg1, unit?: DurationInputArg2): Duration;
230
+ subtract(inp?: DurationInputArg1, unit?: DurationInputArg2): Duration;
231
+
232
+ locale(): string;
233
+ locale(locale: LocaleSpecifier): Duration;
234
+ localeData(): Locale;
235
+
236
+ toISOString(): string;
237
+ toJSON(): string;
238
+
239
+ isValid(): boolean;
240
+
241
+ /**
242
+ * @deprecated since version 2.8.0
243
+ */
244
+ lang(locale: LocaleSpecifier): Moment;
245
+ /**
246
+ * @deprecated since version 2.8.0
247
+ */
248
+ lang(): Locale;
249
+ /**
250
+ * @deprecated
251
+ */
252
+ toIsoString(): string;
253
+ }
254
+
255
+ interface MomentRelativeTime {
256
+ future: any;
257
+ past: any;
258
+ s: any;
259
+ ss: any;
260
+ m: any;
261
+ mm: any;
262
+ h: any;
263
+ hh: any;
264
+ d: any;
265
+ dd: any;
266
+ M: any;
267
+ MM: any;
268
+ y: any;
269
+ yy: any;
270
+ }
271
+
272
+ interface MomentLongDateFormat {
273
+ L: string;
274
+ LL: string;
275
+ LLL: string;
276
+ LLLL: string;
277
+ LT: string;
278
+ LTS: string;
279
+
280
+ l?: string;
281
+ ll?: string;
282
+ lll?: string;
283
+ llll?: string;
284
+ lt?: string;
285
+ lts?: string;
286
+ }
287
+
288
+ interface MomentParsingFlags {
289
+ empty: boolean;
290
+ unusedTokens: string[];
291
+ unusedInput: string[];
292
+ overflow: number;
293
+ charsLeftOver: number;
294
+ nullInput: boolean;
295
+ invalidMonth: string | void; // null
296
+ invalidFormat: boolean;
297
+ userInvalidated: boolean;
298
+ iso: boolean;
299
+ parsedDateParts: any[];
300
+ meridiem: string | void; // null
301
+ }
302
+
303
+ interface MomentParsingFlagsOpt {
304
+ empty?: boolean;
305
+ unusedTokens?: string[];
306
+ unusedInput?: string[];
307
+ overflow?: number;
308
+ charsLeftOver?: number;
309
+ nullInput?: boolean;
310
+ invalidMonth?: string;
311
+ invalidFormat?: boolean;
312
+ userInvalidated?: boolean;
313
+ iso?: boolean;
314
+ parsedDateParts?: any[];
315
+ meridiem?: string;
316
+ }
317
+
318
+ interface MomentBuiltinFormat {
319
+ __momentBuiltinFormatBrand: any;
320
+ }
321
+
322
+ type MomentFormatSpecification = string | MomentBuiltinFormat | (string | MomentBuiltinFormat)[];
323
+
324
+ export namespace unitOfTime {
325
+ type Base = (
326
+ "year" | "years" | "y" |
327
+ "month" | "months" | "M" |
328
+ "week" | "weeks" | "w" |
329
+ "day" | "days" | "d" |
330
+ "hour" | "hours" | "h" |
331
+ "minute" | "minutes" | "m" |
332
+ "second" | "seconds" | "s" |
333
+ "millisecond" | "milliseconds" | "ms"
334
+ );
335
+
336
+ type _quarter = "quarter" | "quarters" | "Q";
337
+ type _isoWeek = "isoWeek" | "isoWeeks" | "W";
338
+ type _date = "date" | "dates" | "D";
339
+ type DurationConstructor = Base | _quarter | _isoWeek;
340
+
341
+ export type DurationAs = Base;
342
+
343
+ export type StartOf = Base | _quarter | _isoWeek | _date | void; // null
344
+
345
+ export type Diff = Base | _quarter;
346
+
347
+ export type MomentConstructor = Base | _date;
348
+
349
+ export type All = Base | _quarter | _isoWeek | _date |
350
+ "weekYear" | "weekYears" | "gg" |
351
+ "isoWeekYear" | "isoWeekYears" | "GG" |
352
+ "dayOfYear" | "dayOfYears" | "DDD" |
353
+ "weekday" | "weekdays" | "e" |
354
+ "isoWeekday" | "isoWeekdays" | "E";
355
+ }
356
+
357
+ type numberlike = number | string;
358
+ interface MomentInputObject {
359
+ years?: numberlike;
360
+ year?: numberlike;
361
+ y?: numberlike;
362
+
363
+ months?: numberlike;
364
+ month?: numberlike;
365
+ M?: numberlike;
366
+
367
+ days?: numberlike;
368
+ day?: numberlike;
369
+ d?: numberlike;
370
+
371
+ dates?: numberlike;
372
+ date?: numberlike;
373
+ D?: numberlike;
374
+
375
+ hours?: numberlike;
376
+ hour?: numberlike;
377
+ h?: numberlike;
378
+
379
+ minutes?: numberlike;
380
+ minute?: numberlike;
381
+ m?: numberlike;
382
+
383
+ seconds?: numberlike;
384
+ second?: numberlike;
385
+ s?: numberlike;
386
+
387
+ milliseconds?: numberlike;
388
+ millisecond?: numberlike;
389
+ ms?: numberlike;
390
+ }
391
+
392
+ interface DurationInputObject extends MomentInputObject {
393
+ quarters?: numberlike;
394
+ quarter?: numberlike;
395
+ Q?: numberlike;
396
+
397
+ weeks?: numberlike;
398
+ week?: numberlike;
399
+ w?: numberlike;
400
+ }
401
+
402
+ interface MomentSetObject extends MomentInputObject {
403
+ weekYears?: numberlike;
404
+ weekYear?: numberlike;
405
+ gg?: numberlike;
406
+
407
+ isoWeekYears?: numberlike;
408
+ isoWeekYear?: numberlike;
409
+ GG?: numberlike;
410
+
411
+ quarters?: numberlike;
412
+ quarter?: numberlike;
413
+ Q?: numberlike;
414
+
415
+ weeks?: numberlike;
416
+ week?: numberlike;
417
+ w?: numberlike;
418
+
419
+ isoWeeks?: numberlike;
420
+ isoWeek?: numberlike;
421
+ W?: numberlike;
422
+
423
+ dayOfYears?: numberlike;
424
+ dayOfYear?: numberlike;
425
+ DDD?: numberlike;
426
+
427
+ weekdays?: numberlike;
428
+ weekday?: numberlike;
429
+ e?: numberlike;
430
+
431
+ isoWeekdays?: numberlike;
432
+ isoWeekday?: numberlike;
433
+ E?: numberlike;
434
+ }
435
+
436
+ interface FromTo {
437
+ from: MomentInput;
438
+ to: MomentInput;
439
+ }
440
+
441
+ type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
442
+ type DurationInputArg1 = Duration | number | string | FromTo | DurationInputObject | void; // null | undefined
443
+ type DurationInputArg2 = unitOfTime.DurationConstructor;
444
+ type LocaleSpecifier = string | Moment | Duration | string[] | boolean;
445
+
446
+ interface MomentCreationData {
447
+ input: MomentInput;
448
+ format?: MomentFormatSpecification;
449
+ locale: Locale;
450
+ isUTC: boolean;
451
+ strict?: boolean;
452
+ }
453
+
454
+ interface Moment extends Object {
455
+ format(format?: string): string;
456
+
457
+ startOf(unitOfTime: unitOfTime.StartOf): Moment;
458
+ endOf(unitOfTime: unitOfTime.StartOf): Moment;
459
+
460
+ add(amount?: DurationInputArg1, unit?: DurationInputArg2): Moment;
461
+ /**
462
+ * @deprecated reverse syntax
463
+ */
464
+ add(unit: unitOfTime.DurationConstructor, amount: number|string): Moment;
465
+
466
+ subtract(amount?: DurationInputArg1, unit?: DurationInputArg2): Moment;
467
+ /**
468
+ * @deprecated reverse syntax
469
+ */
470
+ subtract(unit: unitOfTime.DurationConstructor, amount: number|string): Moment;
471
+
472
+ calendar(): string;
473
+ calendar(formats: CalendarSpec): string;
474
+ calendar(time: MomentInput, formats?: CalendarSpec): string;
475
+
476
+ clone(): Moment;
477
+
478
+ /**
479
+ * @return Unix timestamp in milliseconds
480
+ */
481
+ valueOf(): number;
482
+
483
+ // current date/time in local mode
484
+ local(keepLocalTime?: boolean): Moment;
485
+ isLocal(): boolean;
486
+
487
+ // current date/time in UTC mode
488
+ utc(keepLocalTime?: boolean): Moment;
489
+ isUTC(): boolean;
490
+ /**
491
+ * @deprecated use isUTC
492
+ */
493
+ isUtc(): boolean;
494
+
495
+ parseZone(): Moment;
496
+ isValid(): boolean;
497
+ invalidAt(): number;
498
+
499
+ hasAlignedHourOffset(other?: MomentInput): boolean;
500
+
501
+ creationData(): MomentCreationData;
502
+ parsingFlags(): MomentParsingFlags;
503
+
504
+ year(y: number): Moment;
505
+ year(): number;
506
+ /**
507
+ * @deprecated use year(y)
508
+ */
509
+ years(y: number): Moment;
510
+ /**
511
+ * @deprecated use year()
512
+ */
513
+ years(): number;
514
+ quarter(): number;
515
+ quarter(q: number): Moment;
516
+ quarters(): number;
517
+ quarters(q: number): Moment;
518
+ month(M: number|string): Moment;
519
+ month(): number;
520
+ /**
521
+ * @deprecated use month(M)
522
+ */
523
+ months(M: number|string): Moment;
524
+ /**
525
+ * @deprecated use month()
526
+ */
527
+ months(): number;
528
+ day(d: number|string): Moment;
529
+ day(): number;
530
+ days(d: number|string): Moment;
531
+ days(): number;
532
+ date(d: number): Moment;
533
+ date(): number;
534
+ /**
535
+ * @deprecated use date(d)
536
+ */
537
+ dates(d: number): Moment;
538
+ /**
539
+ * @deprecated use date()
540
+ */
541
+ dates(): number;
542
+ hour(h: number): Moment;
543
+ hour(): number;
544
+ hours(h: number): Moment;
545
+ hours(): number;
546
+ minute(m: number): Moment;
547
+ minute(): number;
548
+ minutes(m: number): Moment;
549
+ minutes(): number;
550
+ second(s: number): Moment;
551
+ second(): number;
552
+ seconds(s: number): Moment;
553
+ seconds(): number;
554
+ millisecond(ms: number): Moment;
555
+ millisecond(): number;
556
+ milliseconds(ms: number): Moment;
557
+ milliseconds(): number;
558
+ weekday(): number;
559
+ weekday(d: number): Moment;
560
+ isoWeekday(): number;
561
+ isoWeekday(d: number|string): Moment;
562
+ weekYear(): number;
563
+ weekYear(d: number): Moment;
564
+ isoWeekYear(): number;
565
+ isoWeekYear(d: number): Moment;
566
+ week(): number;
567
+ week(d: number): Moment;
568
+ weeks(): number;
569
+ weeks(d: number): Moment;
570
+ isoWeek(): number;
571
+ isoWeek(d: number): Moment;
572
+ isoWeeks(): number;
573
+ isoWeeks(d: number): Moment;
574
+ weeksInYear(): number;
575
+ weeksInWeekYear(): number;
576
+ isoWeeksInYear(): number;
577
+ isoWeeksInISOWeekYear(): number;
578
+ dayOfYear(): number;
579
+ dayOfYear(d: number): Moment;
580
+
581
+ from(inp: MomentInput, suffix?: boolean): string;
582
+ to(inp: MomentInput, suffix?: boolean): string;
583
+ fromNow(withoutSuffix?: boolean): string;
584
+ toNow(withoutPrefix?: boolean): string;
585
+
586
+ diff(b: MomentInput, unitOfTime?: unitOfTime.Diff, precise?: boolean): number;
587
+
588
+ toArray(): number[];
589
+ toDate(): Date;
590
+ toISOString(keepOffset?: boolean): string;
591
+ inspect(): string;
592
+ toJSON(): string;
593
+ unix(): number;
594
+
595
+ isLeapYear(): boolean;
596
+ /**
597
+ * @deprecated in favor of utcOffset
598
+ */
599
+ zone(): number;
600
+ zone(b: number|string): Moment;
601
+ utcOffset(): number;
602
+ utcOffset(b: number|string, keepLocalTime?: boolean): Moment;
603
+ isUtcOffset(): boolean;
604
+ daysInMonth(): number;
605
+ isDST(): boolean;
606
+
607
+ zoneAbbr(): string;
608
+ zoneName(): string;
609
+
610
+ isBefore(inp?: MomentInput, granularity?: unitOfTime.StartOf): boolean;
611
+ isAfter(inp?: MomentInput, granularity?: unitOfTime.StartOf): boolean;
612
+ isSame(inp?: MomentInput, granularity?: unitOfTime.StartOf): boolean;
613
+ isSameOrAfter(inp?: MomentInput, granularity?: unitOfTime.StartOf): boolean;
614
+ isSameOrBefore(inp?: MomentInput, granularity?: unitOfTime.StartOf): boolean;
615
+ isBetween(a: MomentInput, b: MomentInput, granularity?: unitOfTime.StartOf, inclusivity?: "()" | "[)" | "(]" | "[]"): boolean;
616
+
617
+ /**
618
+ * @deprecated as of 2.8.0, use locale
619
+ */
620
+ lang(language: LocaleSpecifier): Moment;
621
+ /**
622
+ * @deprecated as of 2.8.0, use locale
623
+ */
624
+ lang(): Locale;
625
+
626
+ locale(): string;
627
+ locale(locale: LocaleSpecifier): Moment;
628
+
629
+ localeData(): Locale;
630
+
631
+ /**
632
+ * @deprecated no reliable implementation
633
+ */
634
+ isDSTShifted(): boolean;
635
+
636
+ // NOTE(constructor): Same as moment constructor
637
+ /**
638
+ * @deprecated as of 2.7.0, use moment.min/max
639
+ */
640
+ max(inp?: MomentInput, format?: MomentFormatSpecification, strict?: boolean): Moment;
641
+ /**
642
+ * @deprecated as of 2.7.0, use moment.min/max
643
+ */
644
+ max(inp?: MomentInput, format?: MomentFormatSpecification, language?: string, strict?: boolean): Moment;
645
+
646
+ // NOTE(constructor): Same as moment constructor
647
+ /**
648
+ * @deprecated as of 2.7.0, use moment.min/max
649
+ */
650
+ min(inp?: MomentInput, format?: MomentFormatSpecification, strict?: boolean): Moment;
651
+ /**
652
+ * @deprecated as of 2.7.0, use moment.min/max
653
+ */
654
+ min(inp?: MomentInput, format?: MomentFormatSpecification, language?: string, strict?: boolean): Moment;
655
+
656
+ get(unit: unitOfTime.All): number;
657
+ set(unit: unitOfTime.All, value: number): Moment;
658
+ set(objectLiteral: MomentSetObject): Moment;
659
+
660
+ toObject(): MomentObjectOutput;
661
+ }
662
+
663
+ export var version: string;
664
+ export var fn: Moment;
665
+
666
+ // NOTE(constructor): Same as moment constructor
667
+ /**
668
+ * @param strict Strict parsing disables the deprecated fallback to the native Date constructor when
669
+ * parsing a string.
670
+ */
671
+ export function utc(inp?: MomentInput, strict?: boolean): Moment;
672
+ /**
673
+ * @param strict Strict parsing requires that the format and input match exactly, including delimiters.
674
+ * Strict parsing is frequently the best parsing option. For more information about choosing strict vs
675
+ * forgiving parsing, see the [parsing guide](https://momentjs.com/guides/#/parsing/).
676
+ */
677
+ export function utc(inp?: MomentInput, format?: MomentFormatSpecification, strict?: boolean): Moment;
678
+ /**
679
+ * @param strict Strict parsing requires that the format and input match exactly, including delimiters.
680
+ * Strict parsing is frequently the best parsing option. For more information about choosing strict vs
681
+ * forgiving parsing, see the [parsing guide](https://momentjs.com/guides/#/parsing/).
682
+ */
683
+ export function utc(inp?: MomentInput, format?: MomentFormatSpecification, language?: string, strict?: boolean): Moment;
684
+
685
+ export function unix(timestamp: number): Moment;
686
+
687
+ export function invalid(flags?: MomentParsingFlagsOpt): Moment;
688
+ export function isMoment(m: any): m is Moment;
689
+ export function isDate(m: any): m is Date;
690
+ export function isDuration(d: any): d is Duration;
691
+
692
+ /**
693
+ * @deprecated in 2.8.0
694
+ */
695
+ export function lang(language?: string): string;
696
+ /**
697
+ * @deprecated in 2.8.0
698
+ */
699
+ export function lang(language?: string, definition?: Locale): string;
700
+
701
+ export function locale(language?: string): string;
702
+ export function locale(language?: string[]): string;
703
+ export function locale(language?: string, definition?: LocaleSpecification | void): string; // null | undefined
704
+
705
+ export function localeData(key?: string | string[]): Locale;
706
+
707
+ export function duration(inp?: DurationInputArg1, unit?: DurationInputArg2): Duration;
708
+
709
+ // NOTE(constructor): Same as moment constructor
710
+ export function parseZone(inp?: MomentInput, format?: MomentFormatSpecification, strict?: boolean): Moment;
711
+ export function parseZone(inp?: MomentInput, format?: MomentFormatSpecification, language?: string, strict?: boolean): Moment;
712
+
713
+ export function months(): string[];
714
+ export function months(index: number): string;
715
+ export function months(format: string): string[];
716
+ export function months(format: string, index: number): string;
717
+ export function monthsShort(): string[];
718
+ export function monthsShort(index: number): string;
719
+ export function monthsShort(format: string): string[];
720
+ export function monthsShort(format: string, index: number): string;
721
+
722
+ export function weekdays(): string[];
723
+ export function weekdays(index: number): string;
724
+ export function weekdays(format: string): string[];
725
+ export function weekdays(format: string, index: number): string;
726
+ export function weekdays(localeSorted: boolean): string[];
727
+ export function weekdays(localeSorted: boolean, index: number): string;
728
+ export function weekdays(localeSorted: boolean, format: string): string[];
729
+ export function weekdays(localeSorted: boolean, format: string, index: number): string;
730
+ export function weekdaysShort(): string[];
731
+ export function weekdaysShort(index: number): string;
732
+ export function weekdaysShort(format: string): string[];
733
+ export function weekdaysShort(format: string, index: number): string;
734
+ export function weekdaysShort(localeSorted: boolean): string[];
735
+ export function weekdaysShort(localeSorted: boolean, index: number): string;
736
+ export function weekdaysShort(localeSorted: boolean, format: string): string[];
737
+ export function weekdaysShort(localeSorted: boolean, format: string, index: number): string;
738
+ export function weekdaysMin(): string[];
739
+ export function weekdaysMin(index: number): string;
740
+ export function weekdaysMin(format: string): string[];
741
+ export function weekdaysMin(format: string, index: number): string;
742
+ export function weekdaysMin(localeSorted: boolean): string[];
743
+ export function weekdaysMin(localeSorted: boolean, index: number): string;
744
+ export function weekdaysMin(localeSorted: boolean, format: string): string[];
745
+ export function weekdaysMin(localeSorted: boolean, format: string, index: number): string;
746
+
747
+ export function min(moments: Moment[]): Moment;
748
+ export function min(...moments: Moment[]): Moment;
749
+ export function max(moments: Moment[]): Moment;
750
+ export function max(...moments: Moment[]): Moment;
751
+
752
+ /**
753
+ * Returns unix time in milliseconds. Overwrite for profit.
754
+ */
755
+ export function now(): number;
756
+
757
+ export function defineLocale(language: string, localeSpec: LocaleSpecification | void): Locale; // null
758
+ export function updateLocale(language: string, localeSpec: LocaleSpecification | void): Locale; // null
759
+
760
+ export function locales(): string[];
761
+
762
+ export function normalizeUnits(unit: unitOfTime.All): string;
763
+ export function relativeTimeThreshold(threshold: string): number | boolean;
764
+ export function relativeTimeThreshold(threshold: string, limit: number): boolean;
765
+ export function relativeTimeRounding(fn: (num: number) => number): boolean;
766
+ export function relativeTimeRounding(): (num: number) => number;
767
+ export function calendarFormat(m: Moment, now: Moment): string;
768
+
769
+ export function parseTwoDigitYear(input: string): number;
770
+
771
+ /**
772
+ * Constant used to enable explicit ISO_8601 format parsing.
773
+ */
774
+ export var ISO_8601: MomentBuiltinFormat;
775
+ export var RFC_2822: MomentBuiltinFormat;
776
+
777
+ export var defaultFormat: string;
778
+ export var defaultFormatUtc: string;
779
+ export var suppressDeprecationWarnings: boolean;
780
+ export var deprecationHandler: ((name: string | void, msg: string) => void) | void;
781
+
782
+ export var HTML5_FMT: {
783
+ DATETIME_LOCAL: string,
784
+ DATETIME_LOCAL_SECONDS: string,
785
+ DATETIME_LOCAL_MS: string,
786
+ DATE: string,
787
+ TIME: string,
788
+ TIME_SECONDS: string,
789
+ TIME_MS: string,
790
+ WEEK: string,
791
+ MONTH: string
792
+ };
793
+
794
+ }
795
+
796
+ export = moment;