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