@nulogy/components 8.7.3 → 8.8.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.
@@ -23012,20 +23012,42 @@ var getShadow = function getShadow(_ref2) {
23012
23012
  }
23013
23013
  };
23014
23014
 
23015
- var showIndicatorSeparator = function showIndicatorSeparator(_ref3) {
23016
- var isMulti = _ref3.isMulti,
23017
- hasValue = _ref3.hasValue,
23018
- hasDefaultOptions = _ref3.hasDefaultOptions;
23015
+ function getControlBorderRadius(_ref3) {
23016
+ var border = _ref3.border,
23017
+ isMenuOpen = _ref3.isMenuOpen,
23018
+ menuLength = _ref3.menuLength,
23019
+ menuPlacement = _ref3.menuPlacement,
23020
+ theme = _ref3.theme;
23021
+ var isMenuEmpty = menuLength === 0;
23022
+ if (!isMenuOpen || isMenuEmpty || border !== menuPlacement) return theme.radii.medium;
23023
+ return 0;
23024
+ }
23025
+ function getMenuBorderRadius(_ref4) {
23026
+ var border = _ref4.border,
23027
+ menuPlacement = _ref4.menuPlacement,
23028
+ theme = _ref4.theme;
23029
+ return border === menuPlacement ? {
23030
+ radius: theme.radii.medium,
23031
+ style: "solid"
23032
+ } : {
23033
+ radius: 0,
23034
+ style: "none"
23035
+ };
23036
+ }
23037
+ var showIndicatorSeparator = function showIndicatorSeparator(_ref5) {
23038
+ var isMulti = _ref5.isMulti,
23039
+ hasValue = _ref5.hasValue,
23040
+ hasDefaultOptions = _ref5.hasDefaultOptions;
23019
23041
  return isMulti && hasValue && hasDefaultOptions;
23020
23042
  };
23021
23043
 
23022
- var customStyles = function customStyles(_ref4) {
23023
- var theme = _ref4.theme,
23024
- error = _ref4.error,
23025
- maxHeight = _ref4.maxHeight,
23026
- windowed = _ref4.windowed,
23027
- _ref4$hasDefaultOptio = _ref4.hasDefaultOptions,
23028
- hasDefaultOptions = _ref4$hasDefaultOptio === void 0 ? true : _ref4$hasDefaultOptio;
23044
+ var customStyles = function customStyles(_ref6) {
23045
+ var theme = _ref6.theme,
23046
+ error = _ref6.error,
23047
+ maxHeight = _ref6.maxHeight,
23048
+ windowed = _ref6.windowed,
23049
+ _ref6$hasDefaultOptio = _ref6.hasDefaultOptions,
23050
+ hasDefaultOptions = _ref6$hasDefaultOptio === void 0 ? true : _ref6$hasDefaultOptio;
23029
23051
  return {
23030
23052
  option: function option() {
23031
23053
  return {
@@ -23058,8 +23080,34 @@ var customStyles = function customStyles(_ref4) {
23058
23080
  theme: theme
23059
23081
  }),
23060
23082
  borderRadius: theme.radii.medium,
23061
- borderBottomLeftRadius: state.selectProps.menuIsOpen && state.selectProps.options.length ? 0 : theme.radii.medium,
23062
- borderBottomRightRadius: state.selectProps.menuIsOpen && state.selectProps.options.length ? 0 : theme.radii.medium,
23083
+ borderBottomLeftRadius: getControlBorderRadius({
23084
+ border: "bottom",
23085
+ isMenuOpen: state.selectProps.menuIsOpen,
23086
+ menuLength: state.selectProps.options.length,
23087
+ menuPlacement: state.selectProps.menuPlacement,
23088
+ theme: theme
23089
+ }),
23090
+ borderBottomRightRadius: getControlBorderRadius({
23091
+ border: "bottom",
23092
+ isMenuOpen: state.selectProps.menuIsOpen,
23093
+ menuLength: state.selectProps.options.length,
23094
+ menuPlacement: state.selectProps.menuPlacement,
23095
+ theme: theme
23096
+ }),
23097
+ borderTopRightRadius: getControlBorderRadius({
23098
+ border: "top",
23099
+ isMenuOpen: state.selectProps.menuIsOpen,
23100
+ menuLength: state.selectProps.options.length,
23101
+ menuPlacement: state.selectProps.menuPlacement,
23102
+ theme: theme
23103
+ }),
23104
+ borderTopLeftRadius: getControlBorderRadius({
23105
+ border: "top",
23106
+ isMenuOpen: state.selectProps.menuIsOpen,
23107
+ menuLength: state.selectProps.options.length,
23108
+ menuPlacement: state.selectProps.menuPlacement,
23109
+ theme: theme
23110
+ }),
23063
23111
  "&:hover, &:focus": {
23064
23112
  borderColor: getBorderColor({
23065
23113
  errored: error,
@@ -23094,8 +23142,9 @@ var customStyles = function customStyles(_ref4) {
23094
23142
  });
23095
23143
  },
23096
23144
  menu: function menu(provided, state) {
23097
- return {
23145
+ return Object.assign(Object.assign({}, provided), {
23098
23146
  marginTop: 0,
23147
+ marginBottom: 0,
23099
23148
  position: "absolute",
23100
23149
  overflowX: "auto",
23101
23150
  zIndex: "100",
@@ -23109,16 +23158,44 @@ var customStyles = function customStyles(_ref4) {
23109
23158
  isFocused: false,
23110
23159
  theme: theme
23111
23160
  }),
23112
- borderBottomStyle: "solid",
23113
23161
  borderLeftStyle: "solid",
23114
23162
  borderRightStyle: "solid",
23115
- borderRadius: "0 0 4px 4px",
23163
+ borderBottomStyle: getMenuBorderRadius({
23164
+ border: "bottom",
23165
+ menuPlacement: state.selectProps.menuPlacement,
23166
+ theme: theme
23167
+ }).style,
23168
+ borderTopStyle: getMenuBorderRadius({
23169
+ border: "top",
23170
+ menuPlacement: state.selectProps.menuPlacement,
23171
+ theme: theme
23172
+ }).style,
23173
+ borderBottomLeftRadius: getMenuBorderRadius({
23174
+ border: "bottom",
23175
+ menuPlacement: state.selectProps.menuPlacement,
23176
+ theme: theme
23177
+ }).radius,
23178
+ borderBottomRightRadius: getMenuBorderRadius({
23179
+ border: "bottom",
23180
+ menuPlacement: state.selectProps.menuPlacement,
23181
+ theme: theme
23182
+ }).radius,
23183
+ borderTopLeftRadius: getMenuBorderRadius({
23184
+ border: "top",
23185
+ menuPlacement: state.selectProps.menuPlacement,
23186
+ theme: theme
23187
+ }).radius,
23188
+ borderTopRightRadius: getMenuBorderRadius({
23189
+ border: "top",
23190
+ menuPlacement: state.selectProps.menuPlacement,
23191
+ theme: theme
23192
+ }).radius,
23116
23193
  boxShadow: getShadow({
23117
23194
  errored: error,
23118
23195
  isOpen: true,
23119
23196
  theme: theme
23120
23197
  })
23121
- };
23198
+ });
23122
23199
  },
23123
23200
  menuList: function menuList(provided) {
23124
23201
  return Object.assign(Object.assign({}, provided), {
@@ -23248,6 +23325,7 @@ var SelectDefaultProps = {
23248
23325
  initialIsOpen: undefined,
23249
23326
  maxHeight: "248px",
23250
23327
  menuPosition: "absolute",
23328
+ menuPlacement: "bottom",
23251
23329
  multiselect: false,
23252
23330
  name: undefined,
23253
23331
  onBlur: undefined,
@@ -27664,7 +27742,7 @@ function toInteger$1(dirtyNumber) {
27664
27742
 
27665
27743
  function requiredArgs$1(required, args) {
27666
27744
  if (args.length < required) {
27667
- throw new TypeError(required + ' argument' + required > 1 ? 's' : '' + ' required, but only ' + args.length + ' present');
27745
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
27668
27746
  }
27669
27747
  }
27670
27748
 
@@ -27711,7 +27789,7 @@ function toDate$1(argument) {
27711
27789
  } else {
27712
27790
  if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
27713
27791
  // eslint-disable-next-line no-console
27714
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
27792
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
27715
27793
 
27716
27794
  console.warn(new Error().stack);
27717
27795
  }
@@ -27733,13 +27811,13 @@ function toDate$1(argument) {
27733
27811
  * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
27734
27812
  *
27735
27813
  * @param {Date|Number} date - the date to be changed
27736
- * @param {Number} amount - the amount of days to be added
27737
- * @returns {Date} the new date with the days added
27738
- * @throws {TypeError} 2 arguments required
27814
+ * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
27815
+ * @returns {Date} - the new date with the days added
27816
+ * @throws {TypeError} - 2 arguments required
27739
27817
  *
27740
27818
  * @example
27741
27819
  * // Add 10 days to 1 September 2014:
27742
- * var result = addDays(new Date(2014, 8, 1), 10)
27820
+ * const result = addDays(new Date(2014, 8, 1), 10)
27743
27821
  * //=> Thu Sep 11 2014 00:00:00
27744
27822
  */
27745
27823
 
@@ -27747,6 +27825,16 @@ function addDays$1(dirtyDate, dirtyAmount) {
27747
27825
  requiredArgs$1(2, arguments);
27748
27826
  var date = toDate$1(dirtyDate);
27749
27827
  var amount = toInteger$1(dirtyAmount);
27828
+
27829
+ if (isNaN(amount)) {
27830
+ return new Date(NaN);
27831
+ }
27832
+
27833
+ if (!amount) {
27834
+ // If 0 days, no-op to avoid changing times in the hour before end of DST
27835
+ return date;
27836
+ }
27837
+
27750
27838
  date.setDate(date.getDate() + amount);
27751
27839
  return date;
27752
27840
  }
@@ -27764,13 +27852,13 @@ function addDays$1(dirtyDate, dirtyAmount) {
27764
27852
  * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
27765
27853
  *
27766
27854
  * @param {Date|Number} date - the date to be changed
27767
- * @param {Number} amount - the amount of milliseconds to be added
27855
+ * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
27768
27856
  * @returns {Date} the new date with the milliseconds added
27769
27857
  * @throws {TypeError} 2 arguments required
27770
27858
  *
27771
27859
  * @example
27772
27860
  * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
27773
- * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
27861
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
27774
27862
  * //=> Thu Jul 10 2014 12:45:30.750
27775
27863
  */
27776
27864
 
@@ -27781,7 +27869,6 @@ function addMilliseconds$1(dirtyDate, dirtyAmount) {
27781
27869
  return new Date(timestamp + amount);
27782
27870
  }
27783
27871
 
27784
- var MILLISECONDS_IN_MINUTE$3 = 60000;
27785
27872
  /**
27786
27873
  * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
27787
27874
  * They usually appear for dates that denote time before the timezones were introduced
@@ -27793,13 +27880,10 @@ var MILLISECONDS_IN_MINUTE$3 = 60000;
27793
27880
  *
27794
27881
  * This function returns the timezone offset in milliseconds that takes seconds in account.
27795
27882
  */
27796
-
27797
- function getTimezoneOffsetInMilliseconds$1(dirtyDate) {
27798
- var date = new Date(dirtyDate.getTime());
27799
- var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());
27800
- date.setSeconds(0, 0);
27801
- var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE$3;
27802
- return baseTimezoneOffset * MILLISECONDS_IN_MINUTE$3 + millisecondsPartOfTimezoneOffset;
27883
+ function getTimezoneOffsetInMilliseconds$1(date) {
27884
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
27885
+ utcDate.setUTCFullYear(date.getFullYear());
27886
+ return date.getTime() - utcDate.getTime();
27803
27887
  }
27804
27888
 
27805
27889
  /**
@@ -27821,7 +27905,7 @@ function getTimezoneOffsetInMilliseconds$1(dirtyDate) {
27821
27905
  *
27822
27906
  * @example
27823
27907
  * // The start of a day for 2 September 2014 11:55:00:
27824
- * var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
27908
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
27825
27909
  * //=> Tue Sep 02 2014 00:00:00
27826
27910
  */
27827
27911
 
@@ -27854,14 +27938,14 @@ var MILLISECONDS_IN_DAY$3 = 86400000;
27854
27938
  * @example
27855
27939
  * // How many calendar days are between
27856
27940
  * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
27857
- * var result = differenceInCalendarDays(
27941
+ * const result = differenceInCalendarDays(
27858
27942
  * new Date(2012, 6, 2, 0, 0),
27859
27943
  * new Date(2011, 6, 2, 23, 0)
27860
27944
  * )
27861
27945
  * //=> 366
27862
27946
  * // How many calendar days are between
27863
27947
  * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
27864
- * var result = differenceInCalendarDays(
27948
+ * const result = differenceInCalendarDays(
27865
27949
  * new Date(2011, 6, 3, 0, 1),
27866
27950
  * new Date(2011, 6, 2, 23, 59)
27867
27951
  * )
@@ -27880,58 +27964,6 @@ function differenceInCalendarDays$1(dirtyDateLeft, dirtyDateRight) {
27880
27964
  return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY$3);
27881
27965
  }
27882
27966
 
27883
- /**
27884
- * @name compareAsc
27885
- * @category Common Helpers
27886
- * @summary Compare the two dates and return -1, 0 or 1.
27887
- *
27888
- * @description
27889
- * Compare the two dates and return 1 if the first date is after the second,
27890
- * -1 if the first date is before the second or 0 if dates are equal.
27891
- *
27892
- * ### v2.0.0 breaking changes:
27893
- *
27894
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
27895
- *
27896
- * @param {Date|Number} dateLeft - the first date to compare
27897
- * @param {Date|Number} dateRight - the second date to compare
27898
- * @returns {Number} the result of the comparison
27899
- * @throws {TypeError} 2 arguments required
27900
- *
27901
- * @example
27902
- * // Compare 11 February 1987 and 10 July 1989:
27903
- * var result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
27904
- * //=> -1
27905
- *
27906
- * @example
27907
- * // Sort the array of dates:
27908
- * var result = [
27909
- * new Date(1995, 6, 2),
27910
- * new Date(1987, 1, 11),
27911
- * new Date(1989, 6, 10)
27912
- * ].sort(compareAsc)
27913
- * //=> [
27914
- * // Wed Feb 11 1987 00:00:00,
27915
- * // Mon Jul 10 1989 00:00:00,
27916
- * // Sun Jul 02 1995 00:00:00
27917
- * // ]
27918
- */
27919
-
27920
- function compareAsc(dirtyDateLeft, dirtyDateRight) {
27921
- requiredArgs$1(2, arguments);
27922
- var dateLeft = toDate$1(dirtyDateLeft);
27923
- var dateRight = toDate$1(dirtyDateRight);
27924
- var diff = dateLeft.getTime() - dateRight.getTime();
27925
-
27926
- if (diff < 0) {
27927
- return -1;
27928
- } else if (diff > 0) {
27929
- return 1; // Return 0 if diff is 0; return NaN if diff is NaN
27930
- } else {
27931
- return diff;
27932
- }
27933
- }
27934
-
27935
27967
  /**
27936
27968
  * @name isValid
27937
27969
  * @category Common Helpers
@@ -28026,13 +28058,37 @@ function isSameDay$1(dirtyDateLeft, dirtyDateRight) {
28026
28058
  return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
28027
28059
  }
28028
28060
 
28061
+ // for accurate equality comparisons of UTC timestamps that end up
28062
+ // having the same representation in local time, e.g. one hour before
28063
+ // DST ends vs. the instant that DST ends.
28064
+
28065
+ function compareLocalAsc(dateLeft, dateRight) {
28066
+ var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();
28067
+
28068
+ if (diff < 0) {
28069
+ return -1;
28070
+ } else if (diff > 0) {
28071
+ return 1; // Return 0 if diff is 0; return NaN if diff is NaN
28072
+ } else {
28073
+ return diff;
28074
+ }
28075
+ }
28029
28076
  /**
28030
28077
  * @name differenceInDays
28031
28078
  * @category Day Helpers
28032
28079
  * @summary Get the number of full days between the given dates.
28033
28080
  *
28034
28081
  * @description
28035
- * Get the number of full day periods between the given dates.
28082
+ * Get the number of full day periods between two dates. Fractional days are
28083
+ * truncated towards zero.
28084
+ *
28085
+ * One "full day" is the distance between a local time in one day to the same
28086
+ * local time on the next or previous day. A full day can sometimes be less than
28087
+ * or more than 24 hours if a daylight savings change happens between two dates.
28088
+ *
28089
+ * To ignore DST and only measure exact 24-hour periods, use this instead:
28090
+ * `Math.floor(differenceInHours(dateLeft, dateRight)/24)|0`.
28091
+ *
28036
28092
  *
28037
28093
  * ### v2.0.0 breaking changes:
28038
28094
  *
@@ -28040,36 +28096,48 @@ function isSameDay$1(dirtyDateLeft, dirtyDateRight) {
28040
28096
  *
28041
28097
  * @param {Date|Number} dateLeft - the later date
28042
28098
  * @param {Date|Number} dateRight - the earlier date
28043
- * @returns {Number} the number of full days
28099
+ * @returns {Number} the number of full days according to the local timezone
28044
28100
  * @throws {TypeError} 2 arguments required
28045
28101
  *
28046
28102
  * @example
28047
28103
  * // How many full days are between
28048
28104
  * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
28049
- * var result = differenceInDays(
28105
+ * const result = differenceInDays(
28050
28106
  * new Date(2012, 6, 2, 0, 0),
28051
28107
  * new Date(2011, 6, 2, 23, 0)
28052
28108
  * )
28053
28109
  * //=> 365
28054
- * // How many days are between
28110
+ * // How many full days are between
28055
28111
  * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
28056
- * var result = differenceInDays(
28112
+ * const result = differenceInDays(
28057
28113
  * new Date(2011, 6, 3, 0, 1),
28058
28114
  * new Date(2011, 6, 2, 23, 59)
28059
28115
  * )
28060
28116
  * //=> 0
28117
+ * // How many full days are between
28118
+ * // 1 March 2020 0:00 and 1 June 2020 0:00 ?
28119
+ * // Note: because local time is used, the
28120
+ * // result will always be 92 days, even in
28121
+ * // time zones where DST starts and the
28122
+ * // period has only 92*24-1 hours.
28123
+ * const result = differenceInDays(
28124
+ * new Date(2020, 5, 1),
28125
+ * new Date(2020, 2, 1)
28126
+ * )
28127
+ //=> 92
28061
28128
  */
28062
28129
 
28130
+
28063
28131
  function differenceInDays(dirtyDateLeft, dirtyDateRight) {
28064
28132
  requiredArgs$1(2, arguments);
28065
28133
  var dateLeft = toDate$1(dirtyDateLeft);
28066
28134
  var dateRight = toDate$1(dirtyDateRight);
28067
- var sign = compareAsc(dateLeft, dateRight);
28135
+ var sign = compareLocalAsc(dateLeft, dateRight);
28068
28136
  var difference = Math.abs(differenceInCalendarDays$1(dateLeft, dateRight));
28069
28137
  dateLeft.setDate(dateLeft.getDate() - sign * difference); // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full
28070
28138
  // If so, result must be decreased by 1 in absolute value
28071
28139
 
28072
- var isLastDayNotFull = compareAsc(dateLeft, dateRight) === -sign;
28140
+ var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign);
28073
28141
  var result = sign * (difference - isLastDayNotFull); // Prevent negative zero
28074
28142
 
28075
28143
  return result === 0 ? 0 : result;
@@ -28105,6 +28173,14 @@ var formatDistanceLocale$9 = {
28105
28173
  one: '1 day',
28106
28174
  other: '{{count}} days'
28107
28175
  },
28176
+ aboutXWeeks: {
28177
+ one: 'about 1 week',
28178
+ other: 'about {{count}} weeks'
28179
+ },
28180
+ xWeeks: {
28181
+ one: '1 week',
28182
+ other: '{{count}} weeks'
28183
+ },
28108
28184
  aboutXMonths: {
28109
28185
  one: 'about 1 month',
28110
28186
  other: 'about {{count}} months'
@@ -28154,8 +28230,9 @@ function formatDistance$9(token, count, options) {
28154
28230
  }
28155
28231
 
28156
28232
  function buildFormatLongFn$1(args) {
28157
- return function (dirtyOptions) {
28158
- var options = dirtyOptions || {};
28233
+ return function () {
28234
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
28235
+ // TODO: Remove String()
28159
28236
  var width = options.width ? String(options.width) : args.defaultWidth;
28160
28237
  var format = args.formats[width] || args.formats[args.defaultWidth];
28161
28238
  return format;
@@ -28225,7 +28302,8 @@ function buildLocalizeFn$1(args) {
28225
28302
  valuesArray = args.values[_width] || args.values[_defaultWidth];
28226
28303
  }
28227
28304
 
28228
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
28305
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challange you to try to remove it!
28306
+
28229
28307
  return valuesArray[index];
28230
28308
  };
28231
28309
  }
@@ -28238,12 +28316,12 @@ var eraValues$9 = {
28238
28316
  var quarterValues$9 = {
28239
28317
  narrow: ['1', '2', '3', '4'],
28240
28318
  abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
28241
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] // Note: in English, the names of days of the week and months are capitalized.
28242
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
28243
- // Generally, formatted dates should look like they are in the middle of a sentence,
28244
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
28319
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
28320
+ }; // Note: in English, the names of days of the week and months are capitalized.
28321
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
28322
+ // Generally, formatted dates should look like they are in the middle of a sentence,
28323
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
28245
28324
 
28246
- };
28247
28325
  var monthValues$9 = {
28248
28326
  narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
28249
28327
  abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
@@ -28379,35 +28457,26 @@ var localize$9 = {
28379
28457
  };
28380
28458
 
28381
28459
  function buildMatchPatternFn$1(args) {
28382
- return function (dirtyString, dirtyOptions) {
28383
- var string = String(dirtyString);
28384
- var options = dirtyOptions || {};
28460
+ return function (string) {
28461
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
28385
28462
  var matchResult = string.match(args.matchPattern);
28386
-
28387
- if (!matchResult) {
28388
- return null;
28389
- }
28390
-
28463
+ if (!matchResult) return null;
28391
28464
  var matchedString = matchResult[0];
28392
28465
  var parseResult = string.match(args.parsePattern);
28393
-
28394
- if (!parseResult) {
28395
- return null;
28396
- }
28397
-
28466
+ if (!parseResult) return null;
28398
28467
  var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
28399
28468
  value = options.valueCallback ? options.valueCallback(value) : value;
28469
+ var rest = string.slice(matchedString.length);
28400
28470
  return {
28401
28471
  value: value,
28402
- rest: string.slice(matchedString.length)
28472
+ rest: rest
28403
28473
  };
28404
28474
  };
28405
28475
  }
28406
28476
 
28407
28477
  function buildMatchFn$1(args) {
28408
- return function (dirtyString, dirtyOptions) {
28409
- var string = String(dirtyString);
28410
- var options = dirtyOptions || {};
28478
+ return function (string) {
28479
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
28411
28480
  var width = options.width;
28412
28481
  var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
28413
28482
  var matchResult = string.match(matchPattern);
@@ -28418,23 +28487,18 @@ function buildMatchFn$1(args) {
28418
28487
 
28419
28488
  var matchedString = matchResult[0];
28420
28489
  var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
28490
+ var key = Array.isArray(parsePatterns) ? findIndex$1(parsePatterns, function (pattern) {
28491
+ return pattern.test(matchedString);
28492
+ }) : findKey$1(parsePatterns, function (pattern) {
28493
+ return pattern.test(matchedString);
28494
+ });
28421
28495
  var value;
28422
-
28423
- if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {
28424
- value = findIndex$1(parsePatterns, function (pattern) {
28425
- return pattern.test(string);
28426
- });
28427
- } else {
28428
- value = findKey$1(parsePatterns, function (pattern) {
28429
- return pattern.test(string);
28430
- });
28431
- }
28432
-
28433
- value = args.valueCallback ? args.valueCallback(value) : value;
28496
+ value = args.valueCallback ? args.valueCallback(key) : key;
28434
28497
  value = options.valueCallback ? options.valueCallback(value) : value;
28498
+ var rest = string.slice(matchedString.length);
28435
28499
  return {
28436
28500
  value: value,
28437
- rest: string.slice(matchedString.length)
28501
+ rest: rest
28438
28502
  };
28439
28503
  };
28440
28504
  }
@@ -28445,6 +28509,8 @@ function findKey$1(object, predicate) {
28445
28509
  return key;
28446
28510
  }
28447
28511
  }
28512
+
28513
+ return undefined;
28448
28514
  }
28449
28515
 
28450
28516
  function findIndex$1(array, predicate) {
@@ -28453,6 +28519,8 @@ function findIndex$1(array, predicate) {
28453
28519
  return key;
28454
28520
  }
28455
28521
  }
28522
+
28523
+ return undefined;
28456
28524
  }
28457
28525
 
28458
28526
  var matchOrdinalNumberPattern$9 = /^(\d+)(th|st|nd|rd)?/i;
@@ -28589,13 +28657,13 @@ var locale$9 = {
28589
28657
  * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
28590
28658
  *
28591
28659
  * @param {Date|Number} date - the date to be changed
28592
- * @param {Number} amount - the amount of milliseconds to be subtracted
28660
+ * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
28593
28661
  * @returns {Date} the new date with the milliseconds subtracted
28594
28662
  * @throws {TypeError} 2 arguments required
28595
28663
  *
28596
28664
  * @example
28597
28665
  * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
28598
- * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
28666
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
28599
28667
  * //=> Thu Jul 10 2014 12:45:29.250
28600
28668
  */
28601
28669
 
@@ -28661,9 +28729,11 @@ var formatters$3 = {
28661
28729
  switch (token) {
28662
28730
  case 'a':
28663
28731
  case 'aa':
28664
- case 'aaa':
28665
28732
  return dayPeriodEnumValue.toUpperCase();
28666
28733
 
28734
+ case 'aaa':
28735
+ return dayPeriodEnumValue;
28736
+
28667
28737
  case 'aaaaa':
28668
28738
  return dayPeriodEnumValue[0];
28669
28739
 
@@ -28868,53 +28938,53 @@ var dayPeriodEnum$1 = {
28868
28938
  afternoon: 'afternoon',
28869
28939
  evening: 'evening',
28870
28940
  night: 'night'
28871
- /*
28872
- * | | Unit | | Unit |
28873
- * |-----|--------------------------------|-----|--------------------------------|
28874
- * | a | AM, PM | A* | Milliseconds in day |
28875
- * | b | AM, PM, noon, midnight | B | Flexible day period |
28876
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
28877
- * | d | Day of month | D | Day of year |
28878
- * | e | Local day of week | E | Day of week |
28879
- * | f | | F* | Day of week in month |
28880
- * | g* | Modified Julian day | G | Era |
28881
- * | h | Hour [1-12] | H | Hour [0-23] |
28882
- * | i! | ISO day of week | I! | ISO week of year |
28883
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
28884
- * | k | Hour [1-24] | K | Hour [0-11] |
28885
- * | l* | (deprecated) | L | Stand-alone month |
28886
- * | m | Minute | M | Month |
28887
- * | n | | N | |
28888
- * | o! | Ordinal number modifier | O | Timezone (GMT) |
28889
- * | p! | Long localized time | P! | Long localized date |
28890
- * | q | Stand-alone quarter | Q | Quarter |
28891
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
28892
- * | s | Second | S | Fraction of second |
28893
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
28894
- * | u | Extended year | U* | Cyclic year |
28895
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
28896
- * | w | Local week of year | W* | Week of month |
28897
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
28898
- * | y | Year (abs) | Y | Local week-numbering year |
28899
- * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
28900
- *
28901
- * Letters marked by * are not implemented but reserved by Unicode standard.
28902
- *
28903
- * Letters marked by ! are non-standard, but implemented by date-fns:
28904
- * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
28905
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
28906
- * i.e. 7 for Sunday, 1 for Monday, etc.
28907
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
28908
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
28909
- * `R` is supposed to be used in conjunction with `I` and `i`
28910
- * for universal ISO week-numbering date, whereas
28911
- * `Y` is supposed to be used in conjunction with `w` and `e`
28912
- * for week-numbering date specific to the locale.
28913
- * - `P` is long localized date format
28914
- * - `p` is long localized time format
28915
- */
28916
-
28917
28941
  };
28942
+ /*
28943
+ * | | Unit | | Unit |
28944
+ * |-----|--------------------------------|-----|--------------------------------|
28945
+ * | a | AM, PM | A* | Milliseconds in day |
28946
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
28947
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
28948
+ * | d | Day of month | D | Day of year |
28949
+ * | e | Local day of week | E | Day of week |
28950
+ * | f | | F* | Day of week in month |
28951
+ * | g* | Modified Julian day | G | Era |
28952
+ * | h | Hour [1-12] | H | Hour [0-23] |
28953
+ * | i! | ISO day of week | I! | ISO week of year |
28954
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
28955
+ * | k | Hour [1-24] | K | Hour [0-11] |
28956
+ * | l* | (deprecated) | L | Stand-alone month |
28957
+ * | m | Minute | M | Month |
28958
+ * | n | | N | |
28959
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
28960
+ * | p! | Long localized time | P! | Long localized date |
28961
+ * | q | Stand-alone quarter | Q | Quarter |
28962
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
28963
+ * | s | Second | S | Fraction of second |
28964
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
28965
+ * | u | Extended year | U* | Cyclic year |
28966
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
28967
+ * | w | Local week of year | W* | Week of month |
28968
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
28969
+ * | y | Year (abs) | Y | Local week-numbering year |
28970
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
28971
+ *
28972
+ * Letters marked by * are not implemented but reserved by Unicode standard.
28973
+ *
28974
+ * Letters marked by ! are non-standard, but implemented by date-fns:
28975
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
28976
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
28977
+ * i.e. 7 for Sunday, 1 for Monday, etc.
28978
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
28979
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
28980
+ * `R` is supposed to be used in conjunction with `I` and `i`
28981
+ * for universal ISO week-numbering date, whereas
28982
+ * `Y` is supposed to be used in conjunction with `w` and `e`
28983
+ * for week-numbering date specific to the locale.
28984
+ * - `P` is long localized date format
28985
+ * - `p` is long localized time format
28986
+ */
28987
+
28918
28988
  var formatters$2 = {
28919
28989
  // Era
28920
28990
  G: function (date, token, localize) {
@@ -29400,12 +29470,17 @@ var formatters$2 = {
29400
29470
  switch (token) {
29401
29471
  case 'a':
29402
29472
  case 'aa':
29403
- case 'aaa':
29404
29473
  return localize.dayPeriod(dayPeriodEnumValue, {
29405
29474
  width: 'abbreviated',
29406
29475
  context: 'formatting'
29407
29476
  });
29408
29477
 
29478
+ case 'aaa':
29479
+ return localize.dayPeriod(dayPeriodEnumValue, {
29480
+ width: 'abbreviated',
29481
+ context: 'formatting'
29482
+ }).toLowerCase();
29483
+
29409
29484
  case 'aaaaa':
29410
29485
  return localize.dayPeriod(dayPeriodEnumValue, {
29411
29486
  width: 'narrow',
@@ -29436,12 +29511,17 @@ var formatters$2 = {
29436
29511
  switch (token) {
29437
29512
  case 'b':
29438
29513
  case 'bb':
29439
- case 'bbb':
29440
29514
  return localize.dayPeriod(dayPeriodEnumValue, {
29441
29515
  width: 'abbreviated',
29442
29516
  context: 'formatting'
29443
29517
  });
29444
29518
 
29519
+ case 'bbb':
29520
+ return localize.dayPeriod(dayPeriodEnumValue, {
29521
+ width: 'abbreviated',
29522
+ context: 'formatting'
29523
+ }).toLowerCase();
29524
+
29445
29525
  case 'bbbbb':
29446
29526
  return localize.dayPeriod(dayPeriodEnumValue, {
29447
29527
  width: 'narrow',
@@ -29811,15 +29891,15 @@ function isProtectedDayOfYearToken$1(token) {
29811
29891
  function isProtectedWeekYearToken$1(token) {
29812
29892
  return protectedWeekYearTokens$1.indexOf(token) !== -1;
29813
29893
  }
29814
- function throwProtectedError$1(token) {
29894
+ function throwProtectedError$1(token, format, input) {
29815
29895
  if (token === 'YYYY') {
29816
- throw new RangeError('Use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr');
29896
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
29817
29897
  } else if (token === 'YY') {
29818
- throw new RangeError('Use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr');
29898
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
29819
29899
  } else if (token === 'D') {
29820
- throw new RangeError('Use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr');
29900
+ throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
29821
29901
  } else if (token === 'DD') {
29822
- throw new RangeError('Use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr');
29902
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
29823
29903
  }
29824
29904
  }
29825
29905
 
@@ -29926,35 +30006,37 @@ var unescapedLatinCharacterRegExp$2 = /[a-zA-Z]/;
29926
30006
  * | | DD | 01, 02, ..., 365, 366 | 9 |
29927
30007
  * | | DDD | 001, 002, ..., 365, 366 | |
29928
30008
  * | | DDDD | ... | 3 |
29929
- * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Su | |
30009
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
29930
30010
  * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
29931
30011
  * | | EEEEE | M, T, W, T, F, S, S | |
29932
30012
  * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
29933
30013
  * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
29934
30014
  * | | io | 1st, 2nd, ..., 7th | 7 |
29935
30015
  * | | ii | 01, 02, ..., 07 | 7 |
29936
- * | | iii | Mon, Tue, Wed, ..., Su | 7 |
30016
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
29937
30017
  * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
29938
30018
  * | | iiiii | M, T, W, T, F, S, S | 7 |
29939
30019
  * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |
29940
30020
  * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
29941
30021
  * | | eo | 2nd, 3rd, ..., 1st | 7 |
29942
30022
  * | | ee | 02, 03, ..., 01 | |
29943
- * | | eee | Mon, Tue, Wed, ..., Su | |
30023
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
29944
30024
  * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
29945
30025
  * | | eeeee | M, T, W, T, F, S, S | |
29946
30026
  * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
29947
30027
  * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
29948
30028
  * | | co | 2nd, 3rd, ..., 1st | 7 |
29949
30029
  * | | cc | 02, 03, ..., 01 | |
29950
- * | | ccc | Mon, Tue, Wed, ..., Su | |
30030
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
29951
30031
  * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
29952
30032
  * | | ccccc | M, T, W, T, F, S, S | |
29953
30033
  * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
29954
- * | AM, PM | a..aaa | AM, PM | |
30034
+ * | AM, PM | a..aa | AM, PM | |
30035
+ * | | aaa | am, pm | |
29955
30036
  * | | aaaa | a.m., p.m. | 2 |
29956
30037
  * | | aaaaa | a, p | |
29957
- * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |
30038
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
30039
+ * | | bbb | am, pm, noon, midnight | |
29958
30040
  * | | bbbb | a.m., p.m., noon, midnight | 2 |
29959
30041
  * | | bbbbb | a, p, n, mi | |
29960
30042
  * | Flexible day period | B..BBB | at night, in the morning, ... | |
@@ -29968,7 +30050,7 @@ var unescapedLatinCharacterRegExp$2 = /[a-zA-Z]/;
29968
30050
  * | | HH | 00, 01, 02, ..., 23 | |
29969
30051
  * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
29970
30052
  * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
29971
- * | | KK | 1, 2, ..., 11, 0 | |
30053
+ * | | KK | 01, 02, ..., 11, 00 | |
29972
30054
  * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
29973
30055
  * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
29974
30056
  * | | kk | 24, 01, 02, ..., 23 | |
@@ -29980,7 +30062,7 @@ var unescapedLatinCharacterRegExp$2 = /[a-zA-Z]/;
29980
30062
  * | | ss | 00, 01, ..., 59 | |
29981
30063
  * | Fraction of second | S | 0, 1, ..., 9 | |
29982
30064
  * | | SS | 00, 01, ..., 99 | |
29983
- * | | SSS | 000, 0001, ..., 999 | |
30065
+ * | | SSS | 000, 001, ..., 999 | |
29984
30066
  * | | SSSS | ... | 3 |
29985
30067
  * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
29986
30068
  * | | XX | -0800, +0530, Z | |
@@ -30000,18 +30082,18 @@ var unescapedLatinCharacterRegExp$2 = /[a-zA-Z]/;
30000
30082
  * | | tt | ... | 3,7 |
30001
30083
  * | Milliseconds timestamp | T | 512969520900 | 7 |
30002
30084
  * | | TT | ... | 3,7 |
30003
- * | Long localized date | P | 05/29/1453 | 7 |
30004
- * | | PP | May 29, 1453 | 7 |
30005
- * | | PPP | May 29th, 1453 | 7 |
30006
- * | | PPPP | Sunday, May 29th, 1453 | 2,7 |
30085
+ * | Long localized date | P | 04/29/1453 | 7 |
30086
+ * | | PP | Apr 29, 1453 | 7 |
30087
+ * | | PPP | April 29th, 1453 | 7 |
30088
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
30007
30089
  * | Long localized time | p | 12:00 AM | 7 |
30008
30090
  * | | pp | 12:00:00 AM | 7 |
30009
30091
  * | | ppp | 12:00:00 AM GMT+2 | 7 |
30010
30092
  * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
30011
- * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |
30012
- * | | PPpp | May 29, 1453, 12:00:00 AM | 7 |
30013
- * | | PPPppp | May 29th, 1453 at ... | 7 |
30014
- * | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 |
30093
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
30094
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
30095
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
30096
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
30015
30097
  * Notes:
30016
30098
  * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
30017
30099
  * are the same as "stand-alone" units, but are different in some languages.
@@ -30126,10 +30208,10 @@ var unescapedLatinCharacterRegExp$2 = /[a-zA-Z]/;
30126
30208
  * @throws {RangeError} `options.locale` must contain `formatLong` property
30127
30209
  * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
30128
30210
  * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
30129
- * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr
30130
- * @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr
30131
- * @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr
30132
- * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr
30211
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
30212
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
30213
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
30214
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
30133
30215
  * @throws {RangeError} format string contains an unescaped latin alphabet character
30134
30216
  *
30135
30217
  * @example
@@ -30222,11 +30304,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
30222
30304
 
30223
30305
  if (formatter) {
30224
30306
  if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken$1(substring)) {
30225
- throwProtectedError$1(substring);
30307
+ throwProtectedError$1(substring, dirtyFormatStr, dirtyDate);
30226
30308
  }
30227
30309
 
30228
30310
  if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken$1(substring)) {
30229
- throwProtectedError$1(substring);
30311
+ throwProtectedError$1(substring, dirtyFormatStr, dirtyDate);
30230
30312
  }
30231
30313
 
30232
30314
  return formatter(utcDate, substring, locale.localize, formatterOptions);
@@ -30245,6 +30327,35 @@ function cleanEscapedString$2(input) {
30245
30327
  return input.match(escapedStringRegExp$2)[1].replace(doubleQuoteRegExp$2, "'");
30246
30328
  }
30247
30329
 
30330
+ /**
30331
+ * @name subDays
30332
+ * @category Day Helpers
30333
+ * @summary Subtract the specified number of days from the given date.
30334
+ *
30335
+ * @description
30336
+ * Subtract the specified number of days from the given date.
30337
+ *
30338
+ * ### v2.0.0 breaking changes:
30339
+ *
30340
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
30341
+ *
30342
+ * @param {Date|Number} date - the date to be changed
30343
+ * @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
30344
+ * @returns {Date} the new date with the days subtracted
30345
+ * @throws {TypeError} 2 arguments required
30346
+ *
30347
+ * @example
30348
+ * // Subtract 10 days from 1 September 2014:
30349
+ * const result = subDays(new Date(2014, 8, 1), 10)
30350
+ * //=> Fri Aug 22 2014 00:00:00
30351
+ */
30352
+
30353
+ function subDays$1(dirtyDate, dirtyAmount) {
30354
+ requiredArgs$1(2, arguments);
30355
+ var amount = toInteger$1(dirtyAmount);
30356
+ return addDays$1(dirtyDate, -amount);
30357
+ }
30358
+
30248
30359
  /**
30249
30360
  * @name isAfter
30250
30361
  * @category Common Helpers
@@ -30305,35 +30416,6 @@ function isBefore$1(dirtyDate, dirtyDateToCompare) {
30305
30416
  return date.getTime() < dateToCompare.getTime();
30306
30417
  }
30307
30418
 
30308
- /**
30309
- * @name subDays
30310
- * @category Day Helpers
30311
- * @summary Subtract the specified number of days from the given date.
30312
- *
30313
- * @description
30314
- * Subtract the specified number of days from the given date.
30315
- *
30316
- * ### v2.0.0 breaking changes:
30317
- *
30318
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
30319
- *
30320
- * @param {Date|Number} date - the date to be changed
30321
- * @param {Number} amount - the amount of days to be subtracted
30322
- * @returns {Date} the new date with the days subtracted
30323
- * @throws {TypeError} 2 arguments required
30324
- *
30325
- * @example
30326
- * // Subtract 10 days from 1 September 2014:
30327
- * var result = subDays(new Date(2014, 8, 1), 10)
30328
- * //=> Fri Aug 22 2014 00:00:00
30329
- */
30330
-
30331
- function subDays$1(dirtyDate, dirtyAmount) {
30332
- requiredArgs$1(2, arguments);
30333
- var amount = toInteger$1(dirtyAmount);
30334
- return addDays$1(dirtyDate, -amount);
30335
- }
30336
-
30337
30419
  /**
30338
30420
  * @name setMinutes
30339
30421
  * @category Minute Helpers
@@ -30353,7 +30435,7 @@ function subDays$1(dirtyDate, dirtyAmount) {
30353
30435
  *
30354
30436
  * @example
30355
30437
  * // Set 45 minutes to 1 September 2014 11:30:40:
30356
- * var result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)
30438
+ * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)
30357
30439
  * //=> Mon Sep 01 2014 11:45:40
30358
30440
  */
30359
30441
 
@@ -37680,6 +37762,26 @@ var formatDistanceLocale$7 = {
37680
37762
  other: '{{count}} Tagen'
37681
37763
  }
37682
37764
  },
37765
+ aboutXWeeks: {
37766
+ standalone: {
37767
+ one: 'etwa ein Woche',
37768
+ other: 'etwa {{count}} Wochen'
37769
+ },
37770
+ withPreposition: {
37771
+ one: 'etwa einem Woche',
37772
+ other: 'etwa {{count}} Wochen'
37773
+ }
37774
+ },
37775
+ xWeeks: {
37776
+ standalone: {
37777
+ one: 'ein Woche',
37778
+ other: '{{count}} Wochen'
37779
+ },
37780
+ withPreposition: {
37781
+ one: 'einem Woche',
37782
+ other: '{{count}} Wochen'
37783
+ }
37784
+ },
37683
37785
  aboutXMonths: {
37684
37786
  standalone: {
37685
37787
  one: 'etwa ein Monat',
@@ -37741,7 +37843,8 @@ var formatDistanceLocale$7 = {
37741
37843
  }
37742
37844
  }
37743
37845
  };
37744
- function formatDistance$7(token, count, options) {
37846
+
37847
+ var formatDistance$7 = function (token, count, options) {
37745
37848
  options = options || {};
37746
37849
  var usageGroup = options.addSuffix ? formatDistanceLocale$7[token].withPreposition : formatDistanceLocale$7[token].standalone;
37747
37850
  var result;
@@ -37751,11 +37854,11 @@ function formatDistance$7(token, count, options) {
37751
37854
  } else if (count === 1) {
37752
37855
  result = usageGroup.one;
37753
37856
  } else {
37754
- result = usageGroup.other.replace('{{count}}', count);
37857
+ result = usageGroup.other.replace('{{count}}', String(count));
37755
37858
  }
37756
37859
 
37757
37860
  if (options.addSuffix) {
37758
- if (options.comparison > 0) {
37861
+ if (options.comparison && options.comparison > 0) {
37759
37862
  return 'in ' + result;
37760
37863
  } else {
37761
37864
  return 'vor ' + result;
@@ -37763,14 +37866,15 @@ function formatDistance$7(token, count, options) {
37763
37866
  }
37764
37867
 
37765
37868
  return result;
37766
- }
37869
+ };
37767
37870
 
37871
+ // DIN 5008: https://de.wikipedia.org/wiki/Datumsformat#DIN_5008
37768
37872
  var dateFormats$7 = {
37769
37873
  full: 'EEEE, do MMMM y',
37770
37874
  // Montag, 7. Januar 2018
37771
37875
  long: 'do MMMM y',
37772
37876
  // 7. Januar 2018
37773
- medium: 'do MMM. y',
37877
+ medium: 'do MMM y',
37774
37878
  // 7. Jan. 2018
37775
37879
  short: 'dd.MM.y' // 07.01.2018
37776
37880
 
@@ -37810,9 +37914,10 @@ var formatRelativeLocale$7 = {
37810
37914
  nextWeek: "eeee 'um' p",
37811
37915
  other: 'P'
37812
37916
  };
37813
- function formatRelative$7(token, _date, _baseDate, _options) {
37917
+
37918
+ var formatRelative$7 = function (token, _date, _baseDate, _options) {
37814
37919
  return formatRelativeLocale$7[token];
37815
- }
37920
+ };
37816
37921
 
37817
37922
  var eraValues$7 = {
37818
37923
  narrow: ['v.Chr.', 'n.Chr.'],
@@ -37822,24 +37927,24 @@ var eraValues$7 = {
37822
37927
  var quarterValues$7 = {
37823
37928
  narrow: ['1', '2', '3', '4'],
37824
37929
  abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
37825
- wide: ['1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal'] // Note: in German, the names of days of the week and months are capitalized.
37826
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
37827
- // Generally, formatted dates should look like they are in the middle of a sentence,
37828
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
37930
+ wide: ['1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal']
37931
+ }; // Note: in German, the names of days of the week and months are capitalized.
37932
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
37933
+ // Generally, formatted dates should look like they are in the middle of a sentence,
37934
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
37829
37935
 
37830
- };
37831
37936
  var monthValues$7 = {
37832
37937
  narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
37833
- abbreviated: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
37938
+ abbreviated: ['Jan.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Dez.'],
37834
37939
  wide: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']
37835
37940
  };
37836
37941
  var dayValues$7 = {
37837
37942
  narrow: ['S', 'M', 'D', 'M', 'D', 'F', 'S'],
37838
37943
  short: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
37839
37944
  abbreviated: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'],
37840
- wide: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'] // https://www.unicode.org/cldr/charts/32/summary/de.html#1881
37945
+ wide: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag']
37946
+ }; // https://www.unicode.org/cldr/charts/32/summary/de.html#1881
37841
37947
 
37842
- };
37843
37948
  var dayPeriodValues$7 = {
37844
37949
  narrow: {
37845
37950
  am: 'vm.',
@@ -37905,10 +38010,10 @@ var formattingDayPeriodValues$4 = {
37905
38010
  }
37906
38011
  };
37907
38012
 
37908
- function ordinalNumber$7(dirtyNumber, _dirtyOptions) {
38013
+ var ordinalNumber$7 = function (dirtyNumber, _dirtyOptions) {
37909
38014
  var number = Number(dirtyNumber);
37910
38015
  return number + '.';
37911
- }
38016
+ };
37912
38017
 
37913
38018
  var localize$7 = {
37914
38019
  ordinalNumber: ordinalNumber$7,
@@ -37920,7 +38025,7 @@ var localize$7 = {
37920
38025
  values: quarterValues$7,
37921
38026
  defaultWidth: 'wide',
37922
38027
  argumentCallback: function (quarter) {
37923
- return Number(quarter) - 1;
38028
+ return quarter - 1;
37924
38029
  }
37925
38030
  }),
37926
38031
  month: buildLocalizeFn$1({
@@ -37999,7 +38104,7 @@ var match$7 = {
37999
38104
  matchPattern: matchOrdinalNumberPattern$7,
38000
38105
  parsePattern: parseOrdinalNumberPattern$7,
38001
38106
  valueCallback: function (value) {
38002
- return parseInt(value, 10);
38107
+ return parseInt(value);
38003
38108
  }
38004
38109
  }),
38005
38110
  era: buildMatchFn$1({
@@ -38049,7 +38154,6 @@ var match$7 = {
38049
38154
  * @author RomanErnst [@pex]{@link https://github.com/pex}
38050
38155
  * @author Philipp Keck [@Philipp91]{@link https://github.com/Philipp91}
38051
38156
  */
38052
-
38053
38157
  var locale$7 = {
38054
38158
  code: 'de',
38055
38159
  formatDistance: formatDistance$7,
@@ -38095,6 +38199,14 @@ var formatDistanceLocale$6 = {
38095
38199
  one: '1 día',
38096
38200
  other: '{{count}} días'
38097
38201
  },
38202
+ aboutXWeeks: {
38203
+ one: 'alrededor de 1 semana',
38204
+ other: 'alrededor de {{count}} semanas'
38205
+ },
38206
+ xWeeks: {
38207
+ one: '1 semana',
38208
+ other: '{{count}} semanas'
38209
+ },
38098
38210
  aboutXMonths: {
38099
38211
  one: 'alrededor de 1 mes',
38100
38212
  other: 'alrededor de {{count}} meses'
@@ -38144,8 +38256,8 @@ function formatDistance$6(token, count, options) {
38144
38256
  }
38145
38257
 
38146
38258
  var dateFormats$6 = {
38147
- full: "EEEE, d 'de' MMMM y",
38148
- long: "d 'de' MMMM y",
38259
+ full: "EEEE, d 'de' MMMM 'de' y",
38260
+ long: "d 'de' MMMM 'de' y",
38149
38261
  medium: 'd MMM y',
38150
38262
  short: 'dd/MM/y'
38151
38263
  };
@@ -38218,7 +38330,7 @@ var monthValues$6 = {
38218
38330
  var dayValues$6 = {
38219
38331
  narrow: ['d', 'l', 'm', 'm', 'j', 'v', 's'],
38220
38332
  short: ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sa'],
38221
- abbreviated: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sab'],
38333
+ abbreviated: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'],
38222
38334
  wide: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado']
38223
38335
  };
38224
38336
  var dayPeriodValues$6 = {
@@ -38352,7 +38464,7 @@ var matchDayPatterns$6 = {
38352
38464
  narrow: /^[dlmjvs]/i,
38353
38465
  short: /^(do|lu|ma|mi|ju|vi|sa)/i,
38354
38466
  abbreviated: /^(dom|lun|mar|mie|jue|vie|sab)/i,
38355
- wide: /^(domingo|lunes|martes|miercoles|jueves|viernes|s[áa]bado)/i
38467
+ wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i
38356
38468
  };
38357
38469
  var parseDayPatterns$6 = {
38358
38470
  narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
@@ -38475,6 +38587,14 @@ var formatDistanceLocale$5 = {
38475
38587
  one: '1 jour',
38476
38588
  other: '{{count}} jours'
38477
38589
  },
38590
+ aboutXWeeks: {
38591
+ one: 'environ 1 semaine',
38592
+ other: 'environ {{count}} semaines'
38593
+ },
38594
+ xWeeks: {
38595
+ one: '1 semaine',
38596
+ other: '{{count}} semaines'
38597
+ },
38478
38598
  aboutXMonths: {
38479
38599
  one: 'environ 1 mois',
38480
38600
  other: 'environ {{count}} mois'
@@ -38793,7 +38913,7 @@ var locale$5 = {
38793
38913
  weekStartsOn: 1
38794
38914
  /* Monday */
38795
38915
  ,
38796
- firstWeekContainsDate: 1
38916
+ firstWeekContainsDate: 4
38797
38917
  }
38798
38918
  };
38799
38919
 
@@ -38827,6 +38947,14 @@ var formatDistanceLocale$4 = {
38827
38947
  one: '1 dag',
38828
38948
  other: '{{count}} dagen'
38829
38949
  },
38950
+ aboutXWeeks: {
38951
+ one: 'ongeveer 1 week',
38952
+ other: 'ongeveer {{count}} weken'
38953
+ },
38954
+ xWeeks: {
38955
+ one: '1 week',
38956
+ other: '{{count}} weken'
38957
+ },
38830
38958
  aboutXMonths: {
38831
38959
  one: 'ongeveer 1 maand',
38832
38960
  other: 'ongeveer {{count}} maanden'
@@ -38932,7 +39060,7 @@ var quarterValues$4 = {
38932
39060
  };
38933
39061
  var monthValues$4 = {
38934
39062
  narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
38935
- abbreviated: ['jan.', 'feb.', 'mrt.', 'apr.', 'mei.', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'],
39063
+ abbreviated: ['jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'],
38936
39064
  wide: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december']
38937
39065
  };
38938
39066
  var dayValues$4 = {
@@ -38947,30 +39075,30 @@ var dayPeriodValues$4 = {
38947
39075
  pm: 'PM',
38948
39076
  midnight: 'middernacht',
38949
39077
  noon: 'het middaguur',
38950
- morning: '\'s ochtends',
38951
- afternoon: '\'s middags',
38952
- evening: '\'s avonds',
38953
- night: '\'s nachts'
39078
+ morning: "'s ochtends",
39079
+ afternoon: "'s middags",
39080
+ evening: "'s avonds",
39081
+ night: "'s nachts"
38954
39082
  },
38955
39083
  abbreviated: {
38956
39084
  am: 'AM',
38957
39085
  pm: 'PM',
38958
39086
  midnight: 'middernacht',
38959
39087
  noon: 'het middaguur',
38960
- morning: '\'s ochtends',
38961
- afternoon: '\'s middags',
38962
- evening: '\'s avonds',
38963
- night: '\'s nachts'
39088
+ morning: "'s ochtends",
39089
+ afternoon: "'s middags",
39090
+ evening: "'s avonds",
39091
+ night: "'s nachts"
38964
39092
  },
38965
39093
  wide: {
38966
39094
  am: 'AM',
38967
39095
  pm: 'PM',
38968
39096
  midnight: 'middernacht',
38969
39097
  noon: 'het middaguur',
38970
- morning: '\'s ochtends',
38971
- afternoon: '\'s middags',
38972
- evening: '\'s avonds',
38973
- night: '\'s nachts'
39098
+ morning: "'s ochtends",
39099
+ afternoon: "'s middags",
39100
+ evening: "'s avonds",
39101
+ night: "'s nachts"
38974
39102
  }
38975
39103
  };
38976
39104
 
@@ -39026,7 +39154,7 @@ var parseQuarterPatterns$4 = {
39026
39154
  };
39027
39155
  var matchMonthPatterns$4 = {
39028
39156
  narrow: /^[jfmasond]/i,
39029
- abbreviated: /^(jan|feb|mrt|apr|mei|jun|jul|aug|sep|okt|nov|dec)\.?/i,
39157
+ abbreviated: /^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,
39030
39158
  wide: /^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i
39031
39159
  };
39032
39160
  var parseMonthPatterns$4 = {
@@ -39201,7 +39329,7 @@ var formatDistanceLocale$3 = {
39201
39329
  },
39202
39330
  aboutXHours: {
39203
39331
  one: {
39204
- regular: 'około godzina',
39332
+ regular: 'około godziny',
39205
39333
  past: 'około godziny',
39206
39334
  future: 'około godzinę'
39207
39335
  },
@@ -39226,6 +39354,16 @@ var formatDistanceLocale$3 = {
39226
39354
  twoFour: '{{count}} dni',
39227
39355
  other: '{{count}} dni'
39228
39356
  },
39357
+ aboutXWeeks: {
39358
+ one: 'około tygodnia',
39359
+ twoFour: 'około {{count}} tygodni',
39360
+ other: 'około {{count}} tygodni'
39361
+ },
39362
+ xWeeks: {
39363
+ one: 'tydzień',
39364
+ twoFour: '{{count}} tygodnie',
39365
+ other: '{{count}} tygodni'
39366
+ },
39229
39367
  aboutXMonths: {
39230
39368
  one: 'około miesiąc',
39231
39369
  twoFour: 'około {{count}} miesiące',
@@ -39668,6 +39806,14 @@ var formatDistanceLocale$2 = {
39668
39806
  one: '1 dia',
39669
39807
  other: '{{count}} dias'
39670
39808
  },
39809
+ aboutXWeeks: {
39810
+ one: 'cerca de 1 semana',
39811
+ other: 'cerca de {{count}} semanas'
39812
+ },
39813
+ xWeeks: {
39814
+ one: '1 semana',
39815
+ other: '{{count}} semanas'
39816
+ },
39671
39817
  aboutXMonths: {
39672
39818
  one: 'cerca de 1 mês',
39673
39819
  other: 'cerca de {{count}} meses'
@@ -39787,10 +39933,10 @@ var monthValues$2 = {
39787
39933
  wide: ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro']
39788
39934
  };
39789
39935
  var dayValues$2 = {
39790
- narrow: ['do', '', '', '', '', '', ''],
39791
- short: ['do', '', '', '', '', '', ''],
39792
- abbreviated: ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'],
39793
- wide: ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado']
39936
+ narrow: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],
39937
+ short: ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sab'],
39938
+ abbreviated: ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado'],
39939
+ wide: ['domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado']
39794
39940
  };
39795
39941
  var dayPeriodValues$2 = {
39796
39942
  narrow: {
@@ -40051,6 +40197,14 @@ var formatDistanceLocale$1 = {
40051
40197
  one: '1 zi',
40052
40198
  other: '{{count}} zile'
40053
40199
  },
40200
+ aboutXWeeks: {
40201
+ one: 'circa o săptămână',
40202
+ other: 'circa {{count}} săptămâni'
40203
+ },
40204
+ xWeeks: {
40205
+ one: '1 săptămână',
40206
+ other: '{{count}} săptămâni'
40207
+ },
40054
40208
  aboutXMonths: {
40055
40209
  one: 'circa 1 lună',
40056
40210
  other: 'circa {{count}} luni'
@@ -40417,6 +40571,14 @@ var formatDistanceLocale = {
40417
40571
  one: '1 天',
40418
40572
  other: '{{count}} 天'
40419
40573
  },
40574
+ aboutXWeeks: {
40575
+ one: '大约 1 个星期',
40576
+ other: '大约 {{count}} 个星期'
40577
+ },
40578
+ xWeeks: {
40579
+ one: '1 个星期',
40580
+ other: '{{count}} 个星期'
40581
+ },
40420
40582
  aboutXMonths: {
40421
40583
  one: '大约 1 个月',
40422
40584
  other: '大约 {{count}} 个月'
@@ -40498,16 +40660,34 @@ var formatLong = {
40498
40660
  })
40499
40661
  };
40500
40662
 
40663
+ function checkWeek(_date, _baseDate, _options, baseFormat) {
40664
+ if (isSameUTCWeek(_date, _baseDate, _options)) {
40665
+ return baseFormat; // in same week
40666
+ } else if (_date.getTime() > _baseDate.getTime()) {
40667
+ return "'下个'" + baseFormat; // in next week
40668
+ }
40669
+
40670
+ return "'上个'" + baseFormat; // in last week
40671
+ }
40672
+
40501
40673
  var formatRelativeLocale = {
40502
- lastWeek: "'上个' eeee p",
40674
+ lastWeek: checkWeek,
40675
+ // days before yesterday, maybe in this week or last week
40503
40676
  yesterday: "'昨天' p",
40504
40677
  today: "'今天' p",
40505
40678
  tomorrow: "'明天' p",
40506
- nextWeek: "'下个' eeee p",
40507
- other: 'P'
40679
+ nextWeek: checkWeek,
40680
+ // days after tomorrow, maybe in this week or next week
40681
+ other: 'PP p'
40508
40682
  };
40509
40683
  function formatRelative(token, _date, _baseDate, _options) {
40510
- return formatRelativeLocale[token];
40684
+ var format = formatRelativeLocale[token];
40685
+
40686
+ if (typeof format === 'function') {
40687
+ return format(_date, _baseDate, _options, 'eeee p');
40688
+ }
40689
+
40690
+ return format;
40511
40691
  }
40512
40692
 
40513
40693
  var eraValues = {
@@ -40610,11 +40790,22 @@ function ordinalNumber(dirtyNumber, dirtyOptions) {
40610
40790
  var options = dirtyOptions || {};
40611
40791
  var unit = String(options.unit);
40612
40792
 
40613
- if (unit === 'date' || unit === 'hour' || unit === 'minute' || unit === 'second') {
40614
- return number.toString();
40615
- }
40793
+ switch (unit) {
40794
+ case 'date':
40795
+ return number.toString() + '日';
40796
+
40797
+ case 'hour':
40798
+ return number.toString() + '时';
40799
+
40800
+ case 'minute':
40801
+ return number.toString() + '分';
40616
40802
 
40617
- return '' + number.toString();
40803
+ case 'second':
40804
+ return number.toString() + '秒';
40805
+
40806
+ default:
40807
+ return '第 ' + number.toString();
40808
+ }
40618
40809
  }
40619
40810
 
40620
40811
  var localize = {
@@ -40646,7 +40837,7 @@ var localize = {
40646
40837
  })
40647
40838
  };
40648
40839
 
40649
- var matchOrdinalNumberPattern = /^(第\s*)?\d+/i;
40840
+ var matchOrdinalNumberPattern = /^(第\s*)?\d+(日|时|分|秒)?/i;
40650
40841
  var parseOrdinalNumberPattern = /\d+/i;
40651
40842
  var matchEraPatterns = {
40652
40843
  narrow: /^(前)/i,
@@ -40671,7 +40862,7 @@ var matchMonthPatterns = {
40671
40862
  };
40672
40863
  var parseMonthPatterns = {
40673
40864
  narrow: [/^一/i, /^二/i, /^三/i, /^四/i, /^五/i, /^六/i, /^七/i, /^八/i, /^九/i, /^十(?!(一|二))/i, /^十一/i, /^十二/i],
40674
- any: [/^一|[!\d]1[!\d]/i, /^二|[!\d]2[!\d]/i, /^三|3/i, /^四|4/i, /^五|5/i, /^六|6/i, /^七|7/i, /^八|8/i, /^九|9/i, /^十(?!(一|二))|10/i, /^十一|11/i, /^十二|12/i]
40865
+ any: [/^一|1/i, /^二|2/i, /^三|3/i, /^四|4/i, /^五|5/i, /^六|6/i, /^七|7/i, /^八|8/i, /^九|9/i, /^十(?!(一|二))|10/i, /^十一|11/i, /^十二|12/i]
40675
40866
  };
40676
40867
  var matchDayPatterns = {
40677
40868
  narrow: /^[一二三四五六日]/i,
@@ -40683,17 +40874,17 @@ var parseDayPatterns = {
40683
40874
  any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i]
40684
40875
  };
40685
40876
  var matchDayPeriodPatterns = {
40686
- any: /^(上午|下午|午夜|[中正]午|早上|下午|晚上?|凌晨)/i
40877
+ any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i
40687
40878
  };
40688
40879
  var parseDayPeriodPatterns = {
40689
40880
  any: {
40690
- am: /^上午/i,
40691
- pm: /^下午/i,
40881
+ am: /^上午?/i,
40882
+ pm: /^下午?/i,
40692
40883
  midnight: /^午夜/i,
40693
40884
  noon: /^[中正]午/i,
40694
40885
  morning: /^早上/i,
40695
40886
  afternoon: /^下午/i,
40696
- evening: /^晚/i,
40887
+ evening: /^晚上?/i,
40697
40888
  night: /^凌晨/i
40698
40889
  }
40699
40890
  };
@@ -40750,6 +40941,7 @@ var match = {
40750
40941
  * @author Song Shuoyun [@fnlctrl]{@link https://github.com/fnlctrl}
40751
40942
  * @author sabrinaM [@sabrinamiao]{@link https://github.com/sabrinamiao}
40752
40943
  * @author Carney Wu [@cubicwork]{@link https://github.com/cubicwork}
40944
+ * @author Terrence Lam [@skyuplam]{@link https://github.com/skyuplam}
40753
40945
  */
40754
40946
 
40755
40947
  var locale = {