@sbb-esta/lyne-elements-experimental-dev 5.1.0-dev.1782984181 → 5.1.0-dev.1783323986

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.
@@ -200,6 +200,133 @@ function toDate(argument, context) {
200
200
  return constructFrom(context || argument, argument);
201
201
  }
202
202
 
203
+ //#endregion
204
+ //#region node_modules/date-fns/_lib/defaultOptions.js
205
+ let defaultOptions = {};
206
+ function getDefaultOptions() {
207
+ return defaultOptions;
208
+ }
209
+
210
+ //#endregion
211
+ //#region node_modules/date-fns/startOfWeek.js
212
+ /**
213
+ * The {@link startOfWeek} function options.
214
+ */
215
+ /**
216
+ * @name startOfWeek
217
+ * @category Week Helpers
218
+ * @summary Return the start of a week for the given date.
219
+ *
220
+ * @description
221
+ * Return the start of a week for the given date.
222
+ * The result will be in the local timezone.
223
+ *
224
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
225
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
226
+ *
227
+ * @param date - The original date
228
+ * @param options - An object with options
229
+ *
230
+ * @returns The start of a week
231
+ *
232
+ * @example
233
+ * // The start of a week for 2 September 2014 11:55:00:
234
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
235
+ * //=> Sun Aug 31 2014 00:00:00
236
+ *
237
+ * @example
238
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
239
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
240
+ * //=> Mon Sep 01 2014 00:00:00
241
+ */
242
+ function startOfWeek(date, options) {
243
+ const defaultOptions = getDefaultOptions();
244
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
245
+ const _date = toDate(date, options?.in);
246
+ const day = _date.getDay();
247
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
248
+ _date.setDate(_date.getDate() - diff);
249
+ _date.setHours(0, 0, 0, 0);
250
+ return _date;
251
+ }
252
+
253
+ //#endregion
254
+ //#region node_modules/date-fns/startOfISOWeek.js
255
+ /**
256
+ * The {@link startOfISOWeek} function options.
257
+ */
258
+ /**
259
+ * @name startOfISOWeek
260
+ * @category ISO Week Helpers
261
+ * @summary Return the start of an ISO week for the given date.
262
+ *
263
+ * @description
264
+ * Return the start of an ISO week for the given date.
265
+ * The result will be in the local timezone.
266
+ *
267
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
268
+ *
269
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
270
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
271
+ *
272
+ * @param date - The original date
273
+ * @param options - An object with options
274
+ *
275
+ * @returns The start of an ISO week
276
+ *
277
+ * @example
278
+ * // The start of an ISO week for 2 September 2014 11:55:00:
279
+ * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
280
+ * //=> Mon Sep 01 2014 00:00:00
281
+ */
282
+ function startOfISOWeek(date, options) {
283
+ return startOfWeek(date, {
284
+ ...options,
285
+ weekStartsOn: 1
286
+ });
287
+ }
288
+
289
+ //#endregion
290
+ //#region node_modules/date-fns/getISOWeekYear.js
291
+ /**
292
+ * The {@link getISOWeekYear} function options.
293
+ */
294
+ /**
295
+ * @name getISOWeekYear
296
+ * @category ISO Week-Numbering Year Helpers
297
+ * @summary Get the ISO week-numbering year of the given date.
298
+ *
299
+ * @description
300
+ * Get the ISO week-numbering year of the given date,
301
+ * which always starts 3 days before the year's first Thursday.
302
+ *
303
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
304
+ *
305
+ * @param date - The given date
306
+ *
307
+ * @returns The ISO week-numbering year
308
+ *
309
+ * @example
310
+ * // Which ISO-week numbering year is 2 January 2005?
311
+ * const result = getISOWeekYear(new Date(2005, 0, 2))
312
+ * //=> 2004
313
+ */
314
+ function getISOWeekYear(date, options) {
315
+ const _date = toDate(date, options?.in);
316
+ const year = _date.getFullYear();
317
+ const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
318
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
319
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
320
+ const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
321
+ const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
322
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
323
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
324
+ const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
325
+ if (_date.getTime() >= startOfNextYear.getTime()) return year + 1;
326
+ else if (_date.getTime() >= startOfThisYear.getTime()) return year;
327
+ else return year - 1;
328
+ }
329
+
203
330
  //#endregion
204
331
  //#region node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
205
332
  /**
@@ -305,6 +432,153 @@ function differenceInCalendarDays(laterDate, earlierDate, options) {
305
432
  return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
306
433
  }
307
434
 
435
+ //#endregion
436
+ //#region node_modules/date-fns/startOfISOWeekYear.js
437
+ /**
438
+ * The {@link startOfISOWeekYear} function options.
439
+ */
440
+ /**
441
+ * @name startOfISOWeekYear
442
+ * @category ISO Week-Numbering Year Helpers
443
+ * @summary Return the start of an ISO week-numbering year for the given date.
444
+ *
445
+ * @description
446
+ * Return the start of an ISO week-numbering year,
447
+ * which always starts 3 days before the year's first Thursday.
448
+ * The result will be in the local timezone.
449
+ *
450
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
451
+ *
452
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
453
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
454
+ *
455
+ * @param date - The original date
456
+ * @param options - An object with options
457
+ *
458
+ * @returns The start of an ISO week-numbering year
459
+ *
460
+ * @example
461
+ * // The start of an ISO week-numbering year for 2 July 2005:
462
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
463
+ * //=> Mon Jan 03 2005 00:00:00
464
+ */
465
+ function startOfISOWeekYear(date, options) {
466
+ const year = getISOWeekYear(date, options);
467
+ const fourthOfJanuary = constructFrom(options?.in || date, 0);
468
+ fourthOfJanuary.setFullYear(year, 0, 4);
469
+ fourthOfJanuary.setHours(0, 0, 0, 0);
470
+ return startOfISOWeek(fourthOfJanuary);
471
+ }
472
+
473
+ //#endregion
474
+ //#region node_modules/date-fns/isDate.js
475
+ /**
476
+ * @name isDate
477
+ * @category Common Helpers
478
+ * @summary Is the given value a date?
479
+ *
480
+ * @description
481
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
482
+ *
483
+ * @param value - The value to check
484
+ *
485
+ * @returns True if the given value is a date
486
+ *
487
+ * @example
488
+ * // For a valid date:
489
+ * const result = isDate(new Date())
490
+ * //=> true
491
+ *
492
+ * @example
493
+ * // For an invalid date:
494
+ * const result = isDate(new Date(NaN))
495
+ * //=> true
496
+ *
497
+ * @example
498
+ * // For some value:
499
+ * const result = isDate('2014-02-31')
500
+ * //=> false
501
+ *
502
+ * @example
503
+ * // For an object:
504
+ * const result = isDate({})
505
+ * //=> false
506
+ */
507
+ function isDate(value) {
508
+ return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
509
+ }
510
+
511
+ //#endregion
512
+ //#region node_modules/date-fns/isValid.js
513
+ /**
514
+ * @name isValid
515
+ * @category Common Helpers
516
+ * @summary Is the given date valid?
517
+ *
518
+ * @description
519
+ * Returns false if argument is Invalid Date and true otherwise.
520
+ * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
521
+ * Invalid Date is a Date, whose time value is NaN.
522
+ *
523
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
524
+ *
525
+ * @param date - The date to check
526
+ *
527
+ * @returns The date is valid
528
+ *
529
+ * @example
530
+ * // For the valid date:
531
+ * const result = isValid(new Date(2014, 1, 31))
532
+ * //=> true
533
+ *
534
+ * @example
535
+ * // For the value, convertible into a date:
536
+ * const result = isValid(1393804800000)
537
+ * //=> true
538
+ *
539
+ * @example
540
+ * // For the invalid date:
541
+ * const result = isValid(new Date(''))
542
+ * //=> false
543
+ */
544
+ function isValid(date) {
545
+ return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
546
+ }
547
+
548
+ //#endregion
549
+ //#region node_modules/date-fns/startOfYear.js
550
+ /**
551
+ * The {@link startOfYear} function options.
552
+ */
553
+ /**
554
+ * @name startOfYear
555
+ * @category Year Helpers
556
+ * @summary Return the start of a year for the given date.
557
+ *
558
+ * @description
559
+ * Return the start of a year for the given date.
560
+ * The result will be in the local timezone.
561
+ *
562
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
563
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
564
+ *
565
+ * @param date - The original date
566
+ * @param options - The options
567
+ *
568
+ * @returns The start of a year
569
+ *
570
+ * @example
571
+ * // The start of a year for 2 September 2014 11:55:00:
572
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
573
+ * //=> Wed Jan 01 2014 00:00:00
574
+ */
575
+ function startOfYear(date, options) {
576
+ const date_ = toDate(date, options?.in);
577
+ date_.setFullYear(date_.getFullYear(), 0, 1);
578
+ date_.setHours(0, 0, 0, 0);
579
+ return date_;
580
+ }
581
+
308
582
  //#endregion
309
583
  //#region node_modules/date-fns/locale/en-US/_lib/formatDistance.js
310
584
  const formatDistanceLocale = {
@@ -884,65 +1158,24 @@ const match = {
884
1158
  //#region node_modules/date-fns/locale/en-US.js
885
1159
  /**
886
1160
  * @category Locales
887
- * @summary English locale (United States).
888
- * @language English
889
- * @iso-639-2 eng
890
- * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
891
- * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
892
- */
893
- const enUS = {
894
- code: "en-US",
895
- formatDistance,
896
- formatLong,
897
- formatRelative,
898
- localize,
899
- match,
900
- options: {
901
- weekStartsOn: 0,
902
- firstWeekContainsDate: 1
903
- }
904
- };
905
-
906
- //#endregion
907
- //#region node_modules/date-fns/_lib/defaultOptions.js
908
- let defaultOptions = {};
909
- function getDefaultOptions() {
910
- return defaultOptions;
911
- }
912
-
913
- //#endregion
914
- //#region node_modules/date-fns/startOfYear.js
915
- /**
916
- * The {@link startOfYear} function options.
917
- */
918
- /**
919
- * @name startOfYear
920
- * @category Year Helpers
921
- * @summary Return the start of a year for the given date.
922
- *
923
- * @description
924
- * Return the start of a year for the given date.
925
- * The result will be in the local timezone.
926
- *
927
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
928
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
929
- *
930
- * @param date - The original date
931
- * @param options - The options
932
- *
933
- * @returns The start of a year
934
- *
935
- * @example
936
- * // The start of a year for 2 September 2014 11:55:00:
937
- * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
938
- * //=> Wed Jan 01 2014 00:00:00
1161
+ * @summary English locale (United States).
1162
+ * @language English
1163
+ * @iso-639-2 eng
1164
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
1165
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
939
1166
  */
940
- function startOfYear(date, options) {
941
- const date_ = toDate(date, options?.in);
942
- date_.setFullYear(date_.getFullYear(), 0, 1);
943
- date_.setHours(0, 0, 0, 0);
944
- return date_;
945
- }
1167
+ const enUS = {
1168
+ code: "en-US",
1169
+ formatDistance,
1170
+ formatLong,
1171
+ formatRelative,
1172
+ localize,
1173
+ match,
1174
+ options: {
1175
+ weekStartsOn: 0,
1176
+ firstWeekContainsDate: 1
1177
+ }
1178
+ };
946
1179
 
947
1180
  //#endregion
948
1181
  //#region node_modules/date-fns/getDayOfYear.js
@@ -972,164 +1205,6 @@ function getDayOfYear(date, options) {
972
1205
  return differenceInCalendarDays(_date, startOfYear(_date)) + 1;
973
1206
  }
974
1207
 
975
- //#endregion
976
- //#region node_modules/date-fns/startOfWeek.js
977
- /**
978
- * The {@link startOfWeek} function options.
979
- */
980
- /**
981
- * @name startOfWeek
982
- * @category Week Helpers
983
- * @summary Return the start of a week for the given date.
984
- *
985
- * @description
986
- * Return the start of a week for the given date.
987
- * The result will be in the local timezone.
988
- *
989
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
990
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
991
- *
992
- * @param date - The original date
993
- * @param options - An object with options
994
- *
995
- * @returns The start of a week
996
- *
997
- * @example
998
- * // The start of a week for 2 September 2014 11:55:00:
999
- * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
1000
- * //=> Sun Aug 31 2014 00:00:00
1001
- *
1002
- * @example
1003
- * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
1004
- * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
1005
- * //=> Mon Sep 01 2014 00:00:00
1006
- */
1007
- function startOfWeek(date, options) {
1008
- const defaultOptions = getDefaultOptions();
1009
- const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
1010
- const _date = toDate(date, options?.in);
1011
- const day = _date.getDay();
1012
- const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
1013
- _date.setDate(_date.getDate() - diff);
1014
- _date.setHours(0, 0, 0, 0);
1015
- return _date;
1016
- }
1017
-
1018
- //#endregion
1019
- //#region node_modules/date-fns/startOfISOWeek.js
1020
- /**
1021
- * The {@link startOfISOWeek} function options.
1022
- */
1023
- /**
1024
- * @name startOfISOWeek
1025
- * @category ISO Week Helpers
1026
- * @summary Return the start of an ISO week for the given date.
1027
- *
1028
- * @description
1029
- * Return the start of an ISO week for the given date.
1030
- * The result will be in the local timezone.
1031
- *
1032
- * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1033
- *
1034
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1035
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
1036
- *
1037
- * @param date - The original date
1038
- * @param options - An object with options
1039
- *
1040
- * @returns The start of an ISO week
1041
- *
1042
- * @example
1043
- * // The start of an ISO week for 2 September 2014 11:55:00:
1044
- * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
1045
- * //=> Mon Sep 01 2014 00:00:00
1046
- */
1047
- function startOfISOWeek(date, options) {
1048
- return startOfWeek(date, {
1049
- ...options,
1050
- weekStartsOn: 1
1051
- });
1052
- }
1053
-
1054
- //#endregion
1055
- //#region node_modules/date-fns/getISOWeekYear.js
1056
- /**
1057
- * The {@link getISOWeekYear} function options.
1058
- */
1059
- /**
1060
- * @name getISOWeekYear
1061
- * @category ISO Week-Numbering Year Helpers
1062
- * @summary Get the ISO week-numbering year of the given date.
1063
- *
1064
- * @description
1065
- * Get the ISO week-numbering year of the given date,
1066
- * which always starts 3 days before the year's first Thursday.
1067
- *
1068
- * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1069
- *
1070
- * @param date - The given date
1071
- *
1072
- * @returns The ISO week-numbering year
1073
- *
1074
- * @example
1075
- * // Which ISO-week numbering year is 2 January 2005?
1076
- * const result = getISOWeekYear(new Date(2005, 0, 2))
1077
- * //=> 2004
1078
- */
1079
- function getISOWeekYear(date, options) {
1080
- const _date = toDate(date, options?.in);
1081
- const year = _date.getFullYear();
1082
- const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
1083
- fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
1084
- fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
1085
- const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
1086
- const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
1087
- fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
1088
- fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
1089
- const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
1090
- if (_date.getTime() >= startOfNextYear.getTime()) return year + 1;
1091
- else if (_date.getTime() >= startOfThisYear.getTime()) return year;
1092
- else return year - 1;
1093
- }
1094
-
1095
- //#endregion
1096
- //#region node_modules/date-fns/startOfISOWeekYear.js
1097
- /**
1098
- * The {@link startOfISOWeekYear} function options.
1099
- */
1100
- /**
1101
- * @name startOfISOWeekYear
1102
- * @category ISO Week-Numbering Year Helpers
1103
- * @summary Return the start of an ISO week-numbering year for the given date.
1104
- *
1105
- * @description
1106
- * Return the start of an ISO week-numbering year,
1107
- * which always starts 3 days before the year's first Thursday.
1108
- * The result will be in the local timezone.
1109
- *
1110
- * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1111
- *
1112
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1113
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
1114
- *
1115
- * @param date - The original date
1116
- * @param options - An object with options
1117
- *
1118
- * @returns The start of an ISO week-numbering year
1119
- *
1120
- * @example
1121
- * // The start of an ISO week-numbering year for 2 July 2005:
1122
- * const result = startOfISOWeekYear(new Date(2005, 6, 2))
1123
- * //=> Mon Jan 03 2005 00:00:00
1124
- */
1125
- function startOfISOWeekYear(date, options) {
1126
- const year = getISOWeekYear(date, options);
1127
- const fourthOfJanuary = constructFrom(options?.in || date, 0);
1128
- fourthOfJanuary.setFullYear(year, 0, 4);
1129
- fourthOfJanuary.setHours(0, 0, 0, 0);
1130
- return startOfISOWeek(fourthOfJanuary);
1131
- }
1132
-
1133
1208
  //#endregion
1134
1209
  //#region node_modules/date-fns/getISOWeek.js
1135
1210
  /**
@@ -1847,81 +1922,6 @@ function message(token, format, input) {
1847
1922
  return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1848
1923
  }
1849
1924
 
1850
- //#endregion
1851
- //#region node_modules/date-fns/isDate.js
1852
- /**
1853
- * @name isDate
1854
- * @category Common Helpers
1855
- * @summary Is the given value a date?
1856
- *
1857
- * @description
1858
- * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
1859
- *
1860
- * @param value - The value to check
1861
- *
1862
- * @returns True if the given value is a date
1863
- *
1864
- * @example
1865
- * // For a valid date:
1866
- * const result = isDate(new Date())
1867
- * //=> true
1868
- *
1869
- * @example
1870
- * // For an invalid date:
1871
- * const result = isDate(new Date(NaN))
1872
- * //=> true
1873
- *
1874
- * @example
1875
- * // For some value:
1876
- * const result = isDate('2014-02-31')
1877
- * //=> false
1878
- *
1879
- * @example
1880
- * // For an object:
1881
- * const result = isDate({})
1882
- * //=> false
1883
- */
1884
- function isDate(value) {
1885
- return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
1886
- }
1887
-
1888
- //#endregion
1889
- //#region node_modules/date-fns/isValid.js
1890
- /**
1891
- * @name isValid
1892
- * @category Common Helpers
1893
- * @summary Is the given date valid?
1894
- *
1895
- * @description
1896
- * Returns false if argument is Invalid Date and true otherwise.
1897
- * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
1898
- * Invalid Date is a Date, whose time value is NaN.
1899
- *
1900
- * Time value of Date: http://es5.github.io/#x15.9.1.1
1901
- *
1902
- * @param date - The date to check
1903
- *
1904
- * @returns The date is valid
1905
- *
1906
- * @example
1907
- * // For the valid date:
1908
- * const result = isValid(new Date(2014, 1, 31))
1909
- * //=> true
1910
- *
1911
- * @example
1912
- * // For the value, convertible into a date:
1913
- * const result = isValid(1393804800000)
1914
- * //=> true
1915
- *
1916
- * @example
1917
- * // For the invalid date:
1918
- * const result = isValid(new Date(''))
1919
- * //=> false
1920
- */
1921
- function isValid(date) {
1922
- return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
1923
- }
1924
-
1925
1925
  //#endregion
1926
1926
  //#region node_modules/date-fns/format.js
1927
1927
  const formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
@@ -226,6 +226,15 @@ function addMinutes(date, amount, options) {
226
226
  return _date;
227
227
  }
228
228
 
229
+ //#endregion
230
+ //#region node_modules/date-fns/_lib/getRoundingMethod.js
231
+ function getRoundingMethod(method) {
232
+ return (number) => {
233
+ const result = (method ? Math[method] : Math.trunc)(number);
234
+ return result === 0 ? 0 : result;
235
+ };
236
+ }
237
+
229
238
  //#endregion
230
239
  //#region node_modules/date-fns/differenceInMilliseconds.js
231
240
  /**
@@ -254,15 +263,6 @@ function differenceInMilliseconds(laterDate, earlierDate) {
254
263
  return +toDate(laterDate) - +toDate(earlierDate);
255
264
  }
256
265
 
257
- //#endregion
258
- //#region node_modules/date-fns/_lib/getRoundingMethod.js
259
- function getRoundingMethod(method) {
260
- return (number) => {
261
- const result = (method ? Math[method] : Math.trunc)(number);
262
- return result === 0 ? 0 : result;
263
- };
264
- }
265
-
266
266
  //#endregion
267
267
  //#region node_modules/date-fns/differenceInMinutes.js
268
268
  /**