@nocobase/plugin-backup-restore 2.2.20 → 2.2.21

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 (195) hide show
  1. package/dist/externalVersion.js +5 -5
  2. package/dist/node_modules/@hapi/topo/package.json +1 -1
  3. package/dist/node_modules/@xhmikosr/decompress/package.json +1 -1
  4. package/dist/node_modules/archiver/package.json +1 -1
  5. package/dist/node_modules/fs-extra/package.json +1 -1
  6. package/dist/node_modules/moment/LICENSE +1 -1
  7. package/dist/node_modules/moment/dist/locale/am-et.js +62 -0
  8. package/dist/node_modules/moment/dist/locale/ar-dz.js +8 -8
  9. package/dist/node_modules/moment/dist/locale/ar-ly.js +8 -8
  10. package/dist/node_modules/moment/dist/locale/ar-ps.js +112 -0
  11. package/dist/node_modules/moment/dist/locale/ar.js +8 -8
  12. package/dist/node_modules/moment/dist/locale/be.js +2 -2
  13. package/dist/node_modules/moment/dist/locale/bs.js +14 -4
  14. package/dist/node_modules/moment/dist/locale/ca.js +7 -7
  15. package/dist/node_modules/moment/dist/locale/cs.js +5 -4
  16. package/dist/node_modules/moment/dist/locale/cv.js +2 -2
  17. package/dist/node_modules/moment/dist/locale/de-at.js +29 -1
  18. package/dist/node_modules/moment/dist/locale/de-ch.js +29 -1
  19. package/dist/node_modules/moment/dist/locale/de.js +29 -1
  20. package/dist/node_modules/moment/dist/locale/en-au.js +6 -6
  21. package/dist/node_modules/moment/dist/locale/en-ca.js +6 -6
  22. package/dist/node_modules/moment/dist/locale/en-gb.js +6 -6
  23. package/dist/node_modules/moment/dist/locale/en-ie.js +6 -6
  24. package/dist/node_modules/moment/dist/locale/en-il.js +6 -6
  25. package/dist/node_modules/moment/dist/locale/en-in.js +6 -6
  26. package/dist/node_modules/moment/dist/locale/en-nz.js +6 -6
  27. package/dist/node_modules/moment/dist/locale/en-sg.js +6 -6
  28. package/dist/node_modules/moment/dist/locale/hu.js +3 -3
  29. package/dist/node_modules/moment/dist/locale/id.js +12 -1
  30. package/dist/node_modules/moment/dist/locale/it.js +4 -4
  31. package/dist/node_modules/moment/dist/locale/ka.js +1 -1
  32. package/dist/node_modules/moment/dist/locale/ku-kmr.js +121 -0
  33. package/dist/node_modules/moment/dist/locale/lt.js +2 -2
  34. package/dist/node_modules/moment/dist/locale/me.js +2 -2
  35. package/dist/node_modules/moment/dist/locale/nb.js +4 -4
  36. package/dist/node_modules/moment/dist/locale/nl-be.js +2 -2
  37. package/dist/node_modules/moment/dist/locale/nl.js +1 -1
  38. package/dist/node_modules/moment/dist/locale/oc-lnc.js +6 -6
  39. package/dist/node_modules/moment/dist/locale/pl.js +1 -1
  40. package/dist/node_modules/moment/dist/locale/ps.js +177 -0
  41. package/dist/node_modules/moment/dist/locale/pt-br.js +14 -6
  42. package/dist/node_modules/moment/dist/locale/ru.js +2 -2
  43. package/dist/node_modules/moment/dist/locale/sv.js +7 -7
  44. package/dist/node_modules/moment/dist/locale/sw.js +56 -14
  45. package/dist/node_modules/moment/dist/locale/tet.js +6 -6
  46. package/dist/node_modules/moment/dist/locale/tlh.js +8 -8
  47. package/dist/node_modules/moment/dist/locale/tzl.js +2 -2
  48. package/dist/node_modules/moment/dist/locale/uk.js +9 -8
  49. package/dist/node_modules/moment/dist/locale/uz-latn.js +1 -1
  50. package/dist/node_modules/moment/dist/locale/uz.js +1 -1
  51. package/dist/node_modules/moment/dist/locale/x-pseudo.js +6 -6
  52. package/dist/node_modules/moment/dist/moment.js +1274 -1042
  53. package/dist/node_modules/moment/dojo.profile.js +11 -0
  54. package/dist/node_modules/moment/ender.js +1 -1
  55. package/dist/node_modules/moment/locale/am-et.js +73 -0
  56. package/dist/node_modules/moment/locale/ar-dz.js +8 -8
  57. package/dist/node_modules/moment/locale/ar-ly.js +8 -8
  58. package/dist/node_modules/moment/locale/ar-ps.js +123 -0
  59. package/dist/node_modules/moment/locale/ar.js +8 -8
  60. package/dist/node_modules/moment/locale/be.js +2 -2
  61. package/dist/node_modules/moment/locale/bm.js +2 -0
  62. package/dist/node_modules/moment/locale/bs.js +14 -4
  63. package/dist/node_modules/moment/locale/ca.js +7 -7
  64. package/dist/node_modules/moment/locale/cs.js +5 -4
  65. package/dist/node_modules/moment/locale/cv.js +2 -2
  66. package/dist/node_modules/moment/locale/de-at.js +29 -1
  67. package/dist/node_modules/moment/locale/de-ch.js +29 -1
  68. package/dist/node_modules/moment/locale/de.js +29 -1
  69. package/dist/node_modules/moment/locale/en-au.js +6 -6
  70. package/dist/node_modules/moment/locale/en-ca.js +6 -6
  71. package/dist/node_modules/moment/locale/en-gb.js +6 -6
  72. package/dist/node_modules/moment/locale/en-ie.js +6 -6
  73. package/dist/node_modules/moment/locale/en-il.js +6 -6
  74. package/dist/node_modules/moment/locale/en-in.js +6 -6
  75. package/dist/node_modules/moment/locale/en-nz.js +6 -6
  76. package/dist/node_modules/moment/locale/en-sg.js +6 -6
  77. package/dist/node_modules/moment/locale/hu.js +3 -3
  78. package/dist/node_modules/moment/locale/id.js +12 -1
  79. package/dist/node_modules/moment/locale/it.js +4 -4
  80. package/dist/node_modules/moment/locale/ka.js +1 -1
  81. package/dist/node_modules/moment/locale/ku-kmr.js +125 -0
  82. package/dist/node_modules/moment/locale/lt.js +2 -2
  83. package/dist/node_modules/moment/locale/me.js +2 -2
  84. package/dist/node_modules/moment/locale/mk.js +0 -1
  85. package/dist/node_modules/moment/locale/nb.js +4 -4
  86. package/dist/node_modules/moment/locale/nl-be.js +2 -2
  87. package/dist/node_modules/moment/locale/nl.js +1 -1
  88. package/dist/node_modules/moment/locale/oc-lnc.js +6 -6
  89. package/dist/node_modules/moment/locale/pl.js +1 -1
  90. package/dist/node_modules/moment/locale/ps.js +188 -0
  91. package/dist/node_modules/moment/locale/pt-br.js +14 -6
  92. package/dist/node_modules/moment/locale/ru.js +2 -2
  93. package/dist/node_modules/moment/locale/sv.js +7 -7
  94. package/dist/node_modules/moment/locale/sw.js +56 -14
  95. package/dist/node_modules/moment/locale/tet.js +6 -6
  96. package/dist/node_modules/moment/locale/tlh.js +8 -8
  97. package/dist/node_modules/moment/locale/tzl.js +2 -2
  98. package/dist/node_modules/moment/locale/uk.js +9 -8
  99. package/dist/node_modules/moment/locale/uz-latn.js +1 -1
  100. package/dist/node_modules/moment/locale/uz.js +1 -1
  101. package/dist/node_modules/moment/locale/x-pseudo.js +6 -6
  102. package/dist/node_modules/moment/min/locales.js +1380 -771
  103. package/dist/node_modules/moment/min/locales.min.js +211 -1
  104. package/dist/node_modules/moment/min/moment-with-locales.js +2705 -1858
  105. package/dist/node_modules/moment/min/moment-with-locales.min.js +216 -1
  106. package/dist/node_modules/moment/min/moment.min.js +8 -1
  107. package/dist/node_modules/moment/moment.d.ts +2 -0
  108. package/dist/node_modules/moment/moment.js +3 -3
  109. package/dist/node_modules/moment/package.json +1 -1
  110. package/dist/node_modules/moment/src/lib/create/check-overflow.js +15 -15
  111. package/dist/node_modules/moment/src/lib/create/from-array.js +77 -10
  112. package/dist/node_modules/moment/src/lib/create/from-string-and-array.js +2 -0
  113. package/dist/node_modules/moment/src/lib/create/parsing-flags.js +1 -0
  114. package/dist/node_modules/moment/src/lib/create/valid.js +25 -24
  115. package/dist/node_modules/moment/src/lib/duration/as.js +3 -15
  116. package/dist/node_modules/moment/src/lib/duration/bubble.js +4 -6
  117. package/dist/node_modules/moment/src/lib/duration/humanize.js +14 -3
  118. package/dist/node_modules/moment/src/lib/format/format.js +7 -4
  119. package/dist/node_modules/moment/src/lib/locale/en.js +6 -6
  120. package/dist/node_modules/moment/src/lib/locale/formats.js +19 -3
  121. package/dist/node_modules/moment/src/lib/locale/locales.js +33 -13
  122. package/dist/node_modules/moment/src/lib/locale/relative.js +25 -2
  123. package/dist/node_modules/moment/src/lib/locale/set.js +4 -0
  124. package/dist/node_modules/moment/src/lib/moment/calendar.js +10 -10
  125. package/dist/node_modules/moment/src/lib/moment/get-set.js +66 -22
  126. package/dist/node_modules/moment/src/lib/moment/min-max.js +15 -3
  127. package/dist/node_modules/moment/src/lib/parse/regex.js +4 -0
  128. package/dist/node_modules/moment/src/lib/units/aliases.js +50 -6
  129. package/dist/node_modules/moment/src/lib/units/day-of-month.js +7 -11
  130. package/dist/node_modules/moment/src/lib/units/day-of-week.js +52 -21
  131. package/dist/node_modules/moment/src/lib/units/day-of-year.js +0 -9
  132. package/dist/node_modules/moment/src/lib/units/era.js +13 -7
  133. package/dist/node_modules/moment/src/lib/units/hour.js +5 -12
  134. package/dist/node_modules/moment/src/lib/units/millisecond.js +0 -10
  135. package/dist/node_modules/moment/src/lib/units/minute.js +7 -12
  136. package/dist/node_modules/moment/src/lib/units/month.js +38 -28
  137. package/dist/node_modules/moment/src/lib/units/offset.js +13 -1
  138. package/dist/node_modules/moment/src/lib/units/priorities.js +18 -5
  139. package/dist/node_modules/moment/src/lib/units/quarter.js +0 -10
  140. package/dist/node_modules/moment/src/lib/units/second.js +7 -12
  141. package/dist/node_modules/moment/src/lib/units/week-calendar-utils.js +22 -8
  142. package/dist/node_modules/moment/src/lib/units/week-year.js +1 -11
  143. package/dist/node_modules/moment/src/lib/units/week.js +8 -15
  144. package/dist/node_modules/moment/src/lib/units/year.js +0 -10
  145. package/dist/node_modules/moment/src/lib/utils/deprecate.js +1 -1
  146. package/dist/node_modules/moment/src/locale/am-et.js +62 -0
  147. package/dist/node_modules/moment/src/locale/ar-dz.js +8 -8
  148. package/dist/node_modules/moment/src/locale/ar-ly.js +8 -8
  149. package/dist/node_modules/moment/src/locale/ar-ps.js +112 -0
  150. package/dist/node_modules/moment/src/locale/ar.js +8 -8
  151. package/dist/node_modules/moment/src/locale/be.js +2 -2
  152. package/dist/node_modules/moment/src/locale/bs.js +14 -4
  153. package/dist/node_modules/moment/src/locale/ca.js +7 -7
  154. package/dist/node_modules/moment/src/locale/cs.js +5 -4
  155. package/dist/node_modules/moment/src/locale/cv.js +2 -2
  156. package/dist/node_modules/moment/src/locale/de-at.js +29 -1
  157. package/dist/node_modules/moment/src/locale/de-ch.js +29 -1
  158. package/dist/node_modules/moment/src/locale/de.js +29 -1
  159. package/dist/node_modules/moment/src/locale/en-au.js +6 -6
  160. package/dist/node_modules/moment/src/locale/en-ca.js +6 -6
  161. package/dist/node_modules/moment/src/locale/en-gb.js +6 -6
  162. package/dist/node_modules/moment/src/locale/en-ie.js +6 -6
  163. package/dist/node_modules/moment/src/locale/en-il.js +6 -6
  164. package/dist/node_modules/moment/src/locale/en-in.js +6 -6
  165. package/dist/node_modules/moment/src/locale/en-nz.js +6 -6
  166. package/dist/node_modules/moment/src/locale/en-sg.js +6 -6
  167. package/dist/node_modules/moment/src/locale/hu.js +3 -3
  168. package/dist/node_modules/moment/src/locale/id.js +12 -1
  169. package/dist/node_modules/moment/src/locale/it.js +4 -4
  170. package/dist/node_modules/moment/src/locale/ka.js +1 -1
  171. package/dist/node_modules/moment/src/locale/ku-kmr.js +121 -0
  172. package/dist/node_modules/moment/src/locale/lt.js +2 -2
  173. package/dist/node_modules/moment/src/locale/me.js +2 -2
  174. package/dist/node_modules/moment/src/locale/nb.js +4 -4
  175. package/dist/node_modules/moment/src/locale/nl-be.js +2 -2
  176. package/dist/node_modules/moment/src/locale/nl.js +1 -1
  177. package/dist/node_modules/moment/src/locale/oc-lnc.js +6 -6
  178. package/dist/node_modules/moment/src/locale/pl.js +1 -1
  179. package/dist/node_modules/moment/src/locale/ps.js +177 -0
  180. package/dist/node_modules/moment/src/locale/pt-br.js +14 -6
  181. package/dist/node_modules/moment/src/locale/ru.js +2 -2
  182. package/dist/node_modules/moment/src/locale/sv.js +7 -7
  183. package/dist/node_modules/moment/src/locale/sw.js +56 -14
  184. package/dist/node_modules/moment/src/locale/tet.js +6 -6
  185. package/dist/node_modules/moment/src/locale/tlh.js +8 -8
  186. package/dist/node_modules/moment/src/locale/tzl.js +2 -2
  187. package/dist/node_modules/moment/src/locale/uk.js +9 -8
  188. package/dist/node_modules/moment/src/locale/uz-latn.js +1 -1
  189. package/dist/node_modules/moment/src/locale/uz.js +1 -1
  190. package/dist/node_modules/moment/src/locale/x-pseudo.js +6 -6
  191. package/dist/node_modules/moment/src/moment.js +2 -2
  192. package/dist/node_modules/moment/ts3.1-typings/moment.d.ts +258 -78
  193. package/dist/node_modules/semver/package.json +1 -1
  194. package/package.json +2 -2
  195. package/dist/node_modules/moment/package.js +0 -11
@@ -13,6 +13,7 @@ import toInt from '../utils/to-int';
13
13
  import isUndefined from '../utils/is-undefined';
14
14
  import compareArrays from '../utils/compare-arrays';
15
15
  import { hooks } from '../utils/hooks';
16
+ import getParsingFlags from '../create/parsing-flags';
16
17
 
17
18
  // FORMATTING
18
19
 
@@ -41,8 +42,12 @@ offset('ZZ', '');
41
42
  addRegexToken('Z', matchShortOffset);
42
43
  addRegexToken('ZZ', matchShortOffset);
43
44
  addParseToken(['Z', 'ZZ'], function (input, array, config) {
45
+ var offset = offsetFromString(matchShortOffset, input);
44
46
  config._useUTC = true;
45
- config._tzm = offsetFromString(matchShortOffset, input);
47
+ config._tzm = offset;
48
+ if (offset === null) {
49
+ getParsingFlags(config).invalidOffset = input;
50
+ }
46
51
  });
47
52
 
48
53
  // HELPERS
@@ -66,6 +71,13 @@ function offsetFromString(matcher, string) {
66
71
  parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
67
72
  minutes = +(parts[1] * 60) + toInt(parts[2]);
68
73
 
74
+ if (
75
+ toInt(parts[2]) > 59 ||
76
+ (parts[0] === '+' ? minutes > 14 * 60 : minutes > 12 * 60)
77
+ ) {
78
+ return null;
79
+ }
80
+
69
81
  return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
70
82
  }
71
83
 
@@ -1,10 +1,23 @@
1
1
  import hasOwnProp from '../utils/has-own-prop';
2
2
 
3
- var priorities = {};
4
-
5
- export function addUnitPriority(unit, priority) {
6
- priorities[unit] = priority;
7
- }
3
+ var priorities = {
4
+ date: 9,
5
+ day: 11,
6
+ weekday: 11,
7
+ isoWeekday: 11,
8
+ dayOfYear: 4,
9
+ hour: 13,
10
+ millisecond: 16,
11
+ minute: 14,
12
+ month: 8,
13
+ quarter: 7,
14
+ second: 15,
15
+ weekYear: 1,
16
+ isoWeekYear: 1,
17
+ week: 5,
18
+ isoWeek: 5,
19
+ year: 1,
20
+ };
8
21
 
9
22
  export function getPrioritizedUnits(unitsObj) {
10
23
  var units = [],
@@ -1,6 +1,4 @@
1
1
  import { addFormatToken } from '../format/format';
2
- import { addUnitAlias } from './aliases';
3
- import { addUnitPriority } from './priorities';
4
2
  import { addRegexToken, match1 } from '../parse/regex';
5
3
  import { addParseToken } from '../parse/token';
6
4
  import { MONTH } from './constants';
@@ -10,14 +8,6 @@ import toInt from '../utils/to-int';
10
8
 
11
9
  addFormatToken('Q', 0, 'Qo', 'quarter');
12
10
 
13
- // ALIASES
14
-
15
- addUnitAlias('quarter', 'Q');
16
-
17
- // PRIORITY
18
-
19
- addUnitPriority('quarter', 7);
20
-
21
11
  // PARSING
22
12
 
23
13
  addRegexToken('Q', match1);
@@ -1,8 +1,11 @@
1
1
  import { makeGetSet } from '../moment/get-set';
2
2
  import { addFormatToken } from '../format/format';
3
- import { addUnitAlias } from './aliases';
4
- import { addUnitPriority } from './priorities';
5
- import { addRegexToken, match1to2, match2 } from '../parse/regex';
3
+ import {
4
+ addRegexToken,
5
+ match1to2,
6
+ match2,
7
+ match1to2HasZero,
8
+ } from '../parse/regex';
6
9
  import { addParseToken } from '../parse/token';
7
10
  import { SECOND } from './constants';
8
11
 
@@ -10,17 +13,9 @@ import { SECOND } from './constants';
10
13
 
11
14
  addFormatToken('s', ['ss', 2], 0, 'second');
12
15
 
13
- // ALIASES
14
-
15
- addUnitAlias('second', 's');
16
-
17
- // PRIORITY
18
-
19
- addUnitPriority('second', 15);
20
-
21
16
  // PARSING
22
17
 
23
- addRegexToken('s', match1to2);
18
+ addRegexToken('s', match1to2, match1to2HasZero);
24
19
  addRegexToken('ss', match1to2, match2);
25
20
  addParseToken(['s', 'ss'], SECOND);
26
21
 
@@ -36,20 +36,20 @@ export function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
36
36
  };
37
37
  }
38
38
 
39
- export function weekOfYear(mom, dow, doy) {
40
- var weekOffset = firstWeekOffset(mom.year(), dow, doy),
41
- week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
39
+ function weekOfYearFromDayOfYear(year, dayOfYear, dow, doy) {
40
+ var weekOffset = firstWeekOffset(year, dow, doy),
41
+ week = Math.floor((dayOfYear - weekOffset - 1) / 7) + 1,
42
42
  resWeek,
43
43
  resYear;
44
44
 
45
45
  if (week < 1) {
46
- resYear = mom.year() - 1;
46
+ resYear = year - 1;
47
47
  resWeek = week + weeksInYear(resYear, dow, doy);
48
- } else if (week > weeksInYear(mom.year(), dow, doy)) {
49
- resWeek = week - weeksInYear(mom.year(), dow, doy);
50
- resYear = mom.year() + 1;
48
+ } else if (week > weeksInYear(year, dow, doy)) {
49
+ resWeek = week - weeksInYear(year, dow, doy);
50
+ resYear = year + 1;
51
51
  } else {
52
- resYear = mom.year();
52
+ resYear = year;
53
53
  resWeek = week;
54
54
  }
55
55
 
@@ -59,6 +59,20 @@ export function weekOfYear(mom, dow, doy) {
59
59
  };
60
60
  }
61
61
 
62
+ export function weekOfYear(mom, dow, doy) {
63
+ return weekOfYearFromDayOfYear(mom.year(), mom.dayOfYear(), dow, doy);
64
+ }
65
+
66
+ export function weekOfYearFromDate(year, month, date, dow, doy) {
67
+ var dayOfYear =
68
+ Math.round(
69
+ (createUTCDate(year, month, date) - createUTCDate(year, 0, 1)) /
70
+ 864e5
71
+ ) + 1;
72
+
73
+ return weekOfYearFromDayOfYear(year, dayOfYear, dow, doy);
74
+ }
75
+
62
76
  export function weeksInYear(year, dow, doy) {
63
77
  var weekOffset = firstWeekOffset(year, dow, doy),
64
78
  weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
@@ -1,6 +1,4 @@
1
1
  import { addFormatToken } from '../format/format';
2
- import { addUnitAlias } from './aliases';
3
- import { addUnitPriority } from './priorities';
4
2
  import {
5
3
  addRegexToken,
6
4
  match1to2,
@@ -42,14 +40,6 @@ addWeekYearFormatToken('GGGGG', 'isoWeekYear');
42
40
 
43
41
  // ALIASES
44
42
 
45
- addUnitAlias('weekYear', 'gg');
46
- addUnitAlias('isoWeekYear', 'GG');
47
-
48
- // PRIORITY
49
-
50
- addUnitPriority('weekYear', 1);
51
- addUnitPriority('isoWeekYear', 1);
52
-
53
43
  // PARSING
54
44
 
55
45
  addRegexToken('G', matchSigned);
@@ -79,7 +69,7 @@ export function getSetWeekYear(input) {
79
69
  this,
80
70
  input,
81
71
  this.week(),
82
- this.weekday(),
72
+ this.weekday() + this.localeData()._week.dow,
83
73
  this.localeData()._week.dow,
84
74
  this.localeData()._week.doy
85
75
  );
@@ -1,7 +1,10 @@
1
1
  import { addFormatToken } from '../format/format';
2
- import { addUnitAlias } from './aliases';
3
- import { addUnitPriority } from './priorities';
4
- import { addRegexToken, match1to2, match2 } from '../parse/regex';
2
+ import {
3
+ addRegexToken,
4
+ match1to2,
5
+ match2,
6
+ match1to2NoLeadingZero,
7
+ } from '../parse/regex';
5
8
  import { addWeekParseToken } from '../parse/token';
6
9
  import toInt from '../utils/to-int';
7
10
  import { weekOfYear } from './week-calendar-utils';
@@ -11,21 +14,11 @@ import { weekOfYear } from './week-calendar-utils';
11
14
  addFormatToken('w', ['ww', 2], 'wo', 'week');
12
15
  addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
13
16
 
14
- // ALIASES
15
-
16
- addUnitAlias('week', 'w');
17
- addUnitAlias('isoWeek', 'W');
18
-
19
- // PRIORITIES
20
-
21
- addUnitPriority('week', 5);
22
- addUnitPriority('isoWeek', 5);
23
-
24
17
  // PARSING
25
18
 
26
- addRegexToken('w', match1to2);
19
+ addRegexToken('w', match1to2, match1to2NoLeadingZero);
27
20
  addRegexToken('ww', match1to2, match2);
28
- addRegexToken('W', match1to2);
21
+ addRegexToken('W', match1to2, match1to2NoLeadingZero);
29
22
  addRegexToken('WW', match1to2, match2);
30
23
 
31
24
  addWeekParseToken(
@@ -1,7 +1,5 @@
1
1
  import { makeGetSet } from '../moment/get-set';
2
2
  import { addFormatToken } from '../format/format';
3
- import { addUnitAlias } from './aliases';
4
- import { addUnitPriority } from './priorities';
5
3
  import {
6
4
  addRegexToken,
7
5
  match1to2,
@@ -34,14 +32,6 @@ addFormatToken(0, ['YYYY', 4], 0, 'year');
34
32
  addFormatToken(0, ['YYYYY', 5], 0, 'year');
35
33
  addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
36
34
 
37
- // ALIASES
38
-
39
- addUnitAlias('year', 'y');
40
-
41
- // PRIORITIES
42
-
43
- addUnitPriority('year', 1);
44
-
45
35
  // PARSING
46
36
 
47
37
  addRegexToken('Y', matchSigned);
@@ -60,7 +60,7 @@ export function deprecateSimple(name, msg) {
60
60
  hooks.deprecationHandler(name, msg);
61
61
  }
62
62
  if (!deprecations[name]) {
63
- warn(msg);
63
+ warn(msg + '\n' + new Error().stack);
64
64
  deprecations[name] = true;
65
65
  }
66
66
  }
@@ -0,0 +1,62 @@
1
+ //! moment.js locale configuration
2
+ //! locale : Amharic (Ethiopia) [am-et]
3
+ //! author : Tekle Ayele : https://github.com/tekleayele
4
+
5
+ import moment from '../moment';
6
+
7
+ export default moment.defineLocale('am-et', {
8
+ months: 'ጃንዩወሪ_ፌብሩወሪ_ማርች_ኤፕሪል_ሜይ_ጁን_ጁላይ_ኦገስት_ሴፕቴምበር_ኦክቶበር_ኖቬምበር_ዲሴምበር'.split(
9
+ '_'
10
+ ),
11
+ monthsShort: 'ጃን_ፌብ_ማር_ኤፕር_ሜይ_ጁን_ጁላይ_ኦገ_ሴፕ_ኦክቶ_ኖቬ_ዲሴ'.split('_'),
12
+ weekdays: 'እሑድ_ሰኞ_ማክሰኞ_እሮብ_ሀሙስ_ዓርብ_ቅዳሜ'.split('_'),
13
+ weekdaysShort: 'እሑ_ሰኞ_ማክ_እሮ_ሀሙ_ዓር_ቅዳ'.split('_'),
14
+ weekdaysMin: 'እሁ_ሰ_ማ_እ_ሀ_ዓ_ቅ'.split('_'),
15
+ meridiemParse: /ጥዋት|ከሰዓት/,
16
+ isPM: function (input) {
17
+ return input === 'ከሰዓት';
18
+ },
19
+ meridiem: function (hours) {
20
+ return hours < 12 ? 'ጥዋት' : 'ከሰዓት';
21
+ },
22
+ longDateFormat: {
23
+ LT: 'h:mm A',
24
+ LTS: 'h:mm:ss A',
25
+ L: 'DD/MM/YYYY',
26
+ LL: 'D MMMM YYYY',
27
+ LLL: 'D MMMM YYYY h:mm A',
28
+ LLLL: 'dddd, D MMMM YYYY h:mm A',
29
+ },
30
+ calendar: {
31
+ sameDay: '[ዛሬ በ] LT',
32
+ nextDay: '[ነገ በ] LT',
33
+ nextWeek: 'dddd [በ] LT',
34
+ lastDay: '[ትናንትና በ] LT',
35
+ lastWeek: '[ያለፈው ሳምንት] dddd [በ] LT',
36
+ sameElse: 'L',
37
+ },
38
+ relativeTime: {
39
+ future: '%s ውስጥ',
40
+ past: '%s በፊት',
41
+ s: 'ጥቂት ሰከንዶች',
42
+ ss: '%d ሰከንዶች',
43
+ m: 'አንድ ደቂቃ',
44
+ mm: '%d ደቂቃዎች',
45
+ h: 'አንድ ሰአት',
46
+ hh: '%d ሰአታት',
47
+ d: 'አንድ ቀን',
48
+ dd: '%d ቀናት',
49
+ M: 'አንድ ወር',
50
+ MM: '%d ወራት',
51
+ y: 'አንድ ዓመት',
52
+ yy: '%d ዓመታት',
53
+ },
54
+ dayOfMonthOrdinalParse: /\d{1,2}(ኛ)/,
55
+ ordinal: function (number) {
56
+ return number + 'ኛ';
57
+ },
58
+ week: {
59
+ dow: 0, // Sunday is the first day of the week.
60
+ doy: 6, // The week that contains Jan 1st is the first week of the year.
61
+ },
62
+ });
@@ -12,14 +12,14 @@ var pluralForm = function (n) {
12
12
  return n === 0
13
13
  ? 0
14
14
  : n === 1
15
- ? 1
16
- : n === 2
17
- ? 2
18
- : n % 100 >= 3 && n % 100 <= 10
19
- ? 3
20
- : n % 100 >= 11
21
- ? 4
22
- : 5;
15
+ ? 1
16
+ : n === 2
17
+ ? 2
18
+ : n % 100 >= 3 && n % 100 <= 10
19
+ ? 3
20
+ : n % 100 >= 11
21
+ ? 4
22
+ : 5;
23
23
  },
24
24
  plurals = {
25
25
  s: [
@@ -20,14 +20,14 @@ var symbolMap = {
20
20
  return n === 0
21
21
  ? 0
22
22
  : n === 1
23
- ? 1
24
- : n === 2
25
- ? 2
26
- : n % 100 >= 3 && n % 100 <= 10
27
- ? 3
28
- : n % 100 >= 11
29
- ? 4
30
- : 5;
23
+ ? 1
24
+ : n === 2
25
+ ? 2
26
+ : n % 100 >= 3 && n % 100 <= 10
27
+ ? 3
28
+ : n % 100 >= 11
29
+ ? 4
30
+ : 5;
31
31
  },
32
32
  plurals = {
33
33
  s: [
@@ -0,0 +1,112 @@
1
+ //! moment.js locale configuration
2
+ //! locale : Arabic (Palestine) [ar-ps]
3
+ //! author : Majd Al-Shihabi : https://github.com/majdal
4
+
5
+ import moment from '../moment';
6
+
7
+ var symbolMap = {
8
+ 1: '١',
9
+ 2: '٢',
10
+ 3: '٣',
11
+ 4: '٤',
12
+ 5: '٥',
13
+ 6: '٦',
14
+ 7: '٧',
15
+ 8: '٨',
16
+ 9: '٩',
17
+ 0: '٠',
18
+ },
19
+ numberMap = {
20
+ '١': '1',
21
+ '٢': '2',
22
+ '٣': '3',
23
+ '٤': '4',
24
+ '٥': '5',
25
+ '٦': '6',
26
+ '٧': '7',
27
+ '٨': '8',
28
+ '٩': '9',
29
+ '٠': '0',
30
+ };
31
+
32
+ export default moment.defineLocale('ar-ps', {
33
+ months: 'كانون الثاني_شباط_آذار_نيسان_أيّار_حزيران_تمّوز_آب_أيلول_تشري الأوّل_تشرين الثاني_كانون الأوّل'.split(
34
+ '_'
35
+ ),
36
+ monthsShort:
37
+ 'ك٢_شباط_آذار_نيسان_أيّار_حزيران_تمّوز_آب_أيلول_ت١_ت٢_ك١'.split('_'),
38
+ weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
39
+ weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
40
+ weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
41
+ weekdaysParseExact: true,
42
+ longDateFormat: {
43
+ LT: 'HH:mm',
44
+ LTS: 'HH:mm:ss',
45
+ L: 'DD/MM/YYYY',
46
+ LL: 'D MMMM YYYY',
47
+ LLL: 'D MMMM YYYY HH:mm',
48
+ LLLL: 'dddd D MMMM YYYY HH:mm',
49
+ },
50
+ meridiemParse: /ص|م/,
51
+ isPM: function (input) {
52
+ return 'م' === input;
53
+ },
54
+ meridiem: function (hour, minute, isLower) {
55
+ if (hour < 12) {
56
+ return 'ص';
57
+ } else {
58
+ return 'م';
59
+ }
60
+ },
61
+ calendar: {
62
+ sameDay: '[اليوم على الساعة] LT',
63
+ nextDay: '[غدا على الساعة] LT',
64
+ nextWeek: 'dddd [على الساعة] LT',
65
+ lastDay: '[أمس على الساعة] LT',
66
+ lastWeek: 'dddd [على الساعة] LT',
67
+ sameElse: 'L',
68
+ },
69
+ relativeTime: {
70
+ future: 'في %s',
71
+ past: 'منذ %s',
72
+ s: 'ثوان',
73
+ ss: '%d ثانية',
74
+ m: 'دقيقة',
75
+ mm: '%d دقائق',
76
+ h: 'ساعة',
77
+ hh: '%d ساعات',
78
+ d: 'يوم',
79
+ dd: '%d أيام',
80
+ M: 'شهر',
81
+ MM: '%d أشهر',
82
+ y: 'سنة',
83
+ yy: '%d سنوات',
84
+ },
85
+ preparse: function (string) {
86
+ return string
87
+ .replace(/[٣٤٥٦٧٨٩٠]/g, function (match) {
88
+ return numberMap[match];
89
+ })
90
+ .split('') // reversed since negative lookbehind not supported everywhere
91
+ .reverse()
92
+ .join('')
93
+ .replace(/[١٢](?![\u062a\u0643])/g, function (match) {
94
+ return numberMap[match];
95
+ })
96
+ .split('')
97
+ .reverse()
98
+ .join('')
99
+ .replace(/،/g, ',');
100
+ },
101
+ postformat: function (string) {
102
+ return string
103
+ .replace(/\d/g, function (match) {
104
+ return symbolMap[match];
105
+ })
106
+ .replace(/,/g, '،');
107
+ },
108
+ week: {
109
+ dow: 0, // Sunday is the first day of the week.
110
+ doy: 6, // The week that contains Jan 6th is the first week of the year.
111
+ },
112
+ });
@@ -34,14 +34,14 @@ var symbolMap = {
34
34
  return n === 0
35
35
  ? 0
36
36
  : n === 1
37
- ? 1
38
- : n === 2
39
- ? 2
40
- : n % 100 >= 3 && n % 100 <= 10
41
- ? 3
42
- : n % 100 >= 11
43
- ? 4
44
- : 5;
37
+ ? 1
38
+ : n === 2
39
+ ? 2
40
+ : n % 100 >= 3 && n % 100 <= 10
41
+ ? 3
42
+ : n % 100 >= 11
43
+ ? 4
44
+ : 5;
45
45
  },
46
46
  plurals = {
47
47
  s: [
@@ -11,8 +11,8 @@ function plural(word, num) {
11
11
  return num % 10 === 1 && num % 100 !== 11
12
12
  ? forms[0]
13
13
  : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
14
- ? forms[1]
15
- : forms[2];
14
+ ? forms[1]
15
+ : forms[2];
16
16
  }
17
17
  function relativeTimeWithPlural(number, withoutSuffix, key) {
18
18
  var format = {
@@ -1,10 +1,22 @@
1
1
  //! moment.js locale configuration
2
2
  //! locale : Bosnian [bs]
3
3
  //! author : Nedim Cholich : https://github.com/frontyard
4
+ //! author : Rasid Redzic : https://github.com/rasidre
4
5
  //! based on (hr) translation by Bojan Marković
5
6
 
6
7
  import moment from '../moment';
7
8
 
9
+ function processRelativeTime(number, withoutSuffix, key, isFuture) {
10
+ switch (key) {
11
+ case 'm':
12
+ return withoutSuffix
13
+ ? 'jedna minuta'
14
+ : isFuture
15
+ ? 'jednu minutu'
16
+ : 'jedne minute';
17
+ }
18
+ }
19
+
8
20
  function translate(number, withoutSuffix, key) {
9
21
  var result = number + ' ';
10
22
  switch (key) {
@@ -17,8 +29,6 @@ function translate(number, withoutSuffix, key) {
17
29
  result += 'sekundi';
18
30
  }
19
31
  return result;
20
- case 'm':
21
- return withoutSuffix ? 'jedna minuta' : 'jedne minute';
22
32
  case 'mm':
23
33
  if (number === 1) {
24
34
  result += 'minuta';
@@ -29,7 +39,7 @@ function translate(number, withoutSuffix, key) {
29
39
  }
30
40
  return result;
31
41
  case 'h':
32
- return withoutSuffix ? 'jedan sat' : 'jednog sata';
42
+ return withoutSuffix ? 'jedan sat' : 'jedan sat';
33
43
  case 'hh':
34
44
  if (number === 1) {
35
45
  result += 'sat';
@@ -130,7 +140,7 @@ export default moment.defineLocale('bs', {
130
140
  past: 'prije %s',
131
141
  s: 'par sekundi',
132
142
  ss: translate,
133
- m: translate,
143
+ m: processRelativeTime,
134
144
  mm: translate,
135
145
  h: translate,
136
146
  hh: translate,
@@ -10,7 +10,7 @@ export default moment.defineLocale('ca', {
10
10
  'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split(
11
11
  '_'
12
12
  ),
13
- format: "de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split(
13
+ format: 'de gener_de febrer_de març_d’abril_de maig_de juny_de juliol_d’agost_de setembre_d’octubre_de novembre_de desembre'.split(
14
14
  '_'
15
15
  ),
16
16
  isFormat: /D[oD]?(\s)+MMMM/,
@@ -82,12 +82,12 @@ export default moment.defineLocale('ca', {
82
82
  number === 1
83
83
  ? 'r'
84
84
  : number === 2
85
- ? 'n'
86
- : number === 3
87
- ? 'r'
88
- : number === 4
89
- ? 't'
90
- : 'è';
85
+ ? 'n'
86
+ : number === 3
87
+ ? 'r'
88
+ : number === 4
89
+ ? 't'
90
+ : 'è';
91
91
  if (period === 'w' || period === 'W') {
92
92
  output = 'a';
93
93
  }
@@ -5,13 +5,14 @@
5
5
  import moment from '../moment';
6
6
 
7
7
  var months = {
8
- format: 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split(
9
- '_'
10
- ),
11
8
  standalone:
12
- 'ledna_února_března_dubna_května_června_července_srpna_září_října_listopadu_prosince'.split(
9
+ 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split(
13
10
  '_'
14
11
  ),
12
+ format: 'ledna_února_března_dubna_května_června_července_srpna_září_října_listopadu_prosince'.split(
13
+ '_'
14
+ ),
15
+ isFormat: /DD?[o.]?(\[[^\[\]]*\]|\s)+MMMM/,
15
16
  },
16
17
  monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'),
17
18
  monthsParse = [
@@ -36,8 +36,8 @@ export default moment.defineLocale('cv', {
36
36
  var affix = /сехет$/i.exec(output)
37
37
  ? 'рен'
38
38
  : /ҫул$/i.exec(output)
39
- ? 'тан'
40
- : 'ран';
39
+ ? 'тан'
40
+ : 'ран';
41
41
  return output + affix;
42
42
  },
43
43
  past: '%s каялла',