@redis-ui/components 46.1.3 → 47.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/Toast/Toaster.style.cjs +2 -2
  2. package/dist/Toast/Toaster.style.js +2 -2
  3. package/dist/Toast/core/mapping.helpers.cjs +1 -1
  4. package/dist/Toast/core/mapping.helpers.js +1 -1
  5. package/dist/index.cjs +1 -5
  6. package/dist/index.d.ts +0 -1
  7. package/dist/index.js +2 -4
  8. package/dist/node_modules/react-loading-skeleton/dist/index.cjs +2 -1
  9. package/dist/node_modules/react-loading-skeleton/dist/index.js +2 -1
  10. package/dist/{packages/components/node_modules → node_modules}/react-toastify/dist/react-toastify.esm.cjs +3 -3
  11. package/dist/{packages/components/node_modules → node_modules}/react-toastify/dist/react-toastify.esm.js +2 -2
  12. package/package.json +2 -4
  13. package/skills/redis-ui-components/SKILL.md +0 -1
  14. package/dist/DatePicker/DatePicker.cjs +0 -32
  15. package/dist/DatePicker/DatePicker.d.ts +0 -6
  16. package/dist/DatePicker/DatePicker.js +0 -31
  17. package/dist/DatePicker/DatePicker.style.cjs +0 -251
  18. package/dist/DatePicker/DatePicker.style.d.ts +0 -3
  19. package/dist/DatePicker/DatePicker.style.js +0 -249
  20. package/dist/DatePicker/DatePicker.types.d.ts +0 -17
  21. package/dist/DatePicker/DatePicker.types.js +0 -1
  22. package/dist/DatePicker/DatePicker.utils.cjs +0 -7
  23. package/dist/DatePicker/DatePicker.utils.d.ts +0 -2
  24. package/dist/DatePicker/DatePicker.utils.js +0 -6
  25. package/dist/DatePicker/RangeDatePicker.cjs +0 -30
  26. package/dist/DatePicker/RangeDatePicker.d.ts +0 -3
  27. package/dist/DatePicker/RangeDatePicker.js +0 -29
  28. package/dist/DatePicker/components/CustomDropdown/CustomDropdown.cjs +0 -34
  29. package/dist/DatePicker/components/CustomDropdown/CustomDropdown.d.ts +0 -3
  30. package/dist/DatePicker/components/CustomDropdown/CustomDropdown.js +0 -32
  31. package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.cjs +0 -11
  32. package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.d.ts +0 -2
  33. package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.js +0 -10
  34. package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.cjs +0 -11
  35. package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.d.ts +0 -2
  36. package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.js +0 -10
  37. package/dist/DatePicker/index.d.ts +0 -3
  38. package/dist/DatePicker/index.js +0 -2
  39. package/dist/node_modules/date-fns/_lib/addLeadingZeros.cjs +0 -6
  40. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +0 -6
  41. package/dist/node_modules/date-fns/_lib/defaultOptions.cjs +0 -7
  42. package/dist/node_modules/date-fns/_lib/defaultOptions.js +0 -7
  43. package/dist/node_modules/date-fns/_lib/format/formatters.cjs +0 -418
  44. package/dist/node_modules/date-fns/_lib/format/formatters.js +0 -418
  45. package/dist/node_modules/date-fns/_lib/format/lightFormatters.cjs +0 -45
  46. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +0 -45
  47. package/dist/node_modules/date-fns/_lib/format/longFormatters.cjs +0 -45
  48. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +0 -45
  49. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs +0 -21
  50. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -21
  51. package/dist/node_modules/date-fns/_lib/protectedTokens.cjs +0 -28
  52. package/dist/node_modules/date-fns/_lib/protectedTokens.js +0 -26
  53. package/dist/node_modules/date-fns/addDays.cjs +0 -32
  54. package/dist/node_modules/date-fns/addDays.js +0 -32
  55. package/dist/node_modules/date-fns/addMonths.cjs +0 -42
  56. package/dist/node_modules/date-fns/addMonths.js +0 -42
  57. package/dist/node_modules/date-fns/addWeeks.cjs +0 -27
  58. package/dist/node_modules/date-fns/addWeeks.js +0 -27
  59. package/dist/node_modules/date-fns/addYears.cjs +0 -27
  60. package/dist/node_modules/date-fns/addYears.js +0 -27
  61. package/dist/node_modules/date-fns/constants.cjs +0 -39
  62. package/dist/node_modules/date-fns/constants.js +0 -38
  63. package/dist/node_modules/date-fns/constructFrom.cjs +0 -37
  64. package/dist/node_modules/date-fns/constructFrom.js +0 -37
  65. package/dist/node_modules/date-fns/differenceInCalendarDays.cjs +0 -45
  66. package/dist/node_modules/date-fns/differenceInCalendarDays.js +0 -45
  67. package/dist/node_modules/date-fns/differenceInCalendarMonths.cjs +0 -34
  68. package/dist/node_modules/date-fns/differenceInCalendarMonths.js +0 -34
  69. package/dist/node_modules/date-fns/differenceInCalendarWeeks.cjs +0 -50
  70. package/dist/node_modules/date-fns/differenceInCalendarWeeks.js +0 -50
  71. package/dist/node_modules/date-fns/endOfISOWeek.cjs +0 -29
  72. package/dist/node_modules/date-fns/endOfISOWeek.js +0 -29
  73. package/dist/node_modules/date-fns/endOfMonth.cjs +0 -31
  74. package/dist/node_modules/date-fns/endOfMonth.js +0 -31
  75. package/dist/node_modules/date-fns/endOfWeek.cjs +0 -44
  76. package/dist/node_modules/date-fns/endOfWeek.js +0 -44
  77. package/dist/node_modules/date-fns/format.cjs +0 -357
  78. package/dist/node_modules/date-fns/format.js +0 -357
  79. package/dist/node_modules/date-fns/getDayOfYear.cjs +0 -29
  80. package/dist/node_modules/date-fns/getDayOfYear.js +0 -29
  81. package/dist/node_modules/date-fns/getDaysInMonth.cjs +0 -33
  82. package/dist/node_modules/date-fns/getDaysInMonth.js +0 -33
  83. package/dist/node_modules/date-fns/getISOWeek.cjs +0 -33
  84. package/dist/node_modules/date-fns/getISOWeek.js +0 -33
  85. package/dist/node_modules/date-fns/getISOWeekYear.cjs +0 -43
  86. package/dist/node_modules/date-fns/getISOWeekYear.js +0 -43
  87. package/dist/node_modules/date-fns/getUnixTime.cjs +0 -26
  88. package/dist/node_modules/date-fns/getUnixTime.js +0 -26
  89. package/dist/node_modules/date-fns/getWeek.cjs +0 -51
  90. package/dist/node_modules/date-fns/getWeek.js +0 -51
  91. package/dist/node_modules/date-fns/getWeekYear.cjs +0 -63
  92. package/dist/node_modules/date-fns/getWeekYear.js +0 -63
  93. package/dist/node_modules/date-fns/getWeeksInMonth.cjs +0 -38
  94. package/dist/node_modules/date-fns/getWeeksInMonth.js +0 -38
  95. package/dist/node_modules/date-fns/isAfter.cjs +0 -29
  96. package/dist/node_modules/date-fns/isAfter.js +0 -29
  97. package/dist/node_modules/date-fns/isBefore.cjs +0 -29
  98. package/dist/node_modules/date-fns/isBefore.js +0 -29
  99. package/dist/node_modules/date-fns/isDate.cjs +0 -38
  100. package/dist/node_modules/date-fns/isDate.js +0 -38
  101. package/dist/node_modules/date-fns/isSameDay.cjs +0 -39
  102. package/dist/node_modules/date-fns/isSameDay.js +0 -39
  103. package/dist/node_modules/date-fns/isSameMonth.cjs +0 -34
  104. package/dist/node_modules/date-fns/isSameMonth.js +0 -34
  105. package/dist/node_modules/date-fns/isSameYear.cjs +0 -29
  106. package/dist/node_modules/date-fns/isSameYear.js +0 -29
  107. package/dist/node_modules/date-fns/isValid.cjs +0 -43
  108. package/dist/node_modules/date-fns/isValid.js +0 -43
  109. package/dist/node_modules/date-fns/lastDayOfMonth.cjs +0 -31
  110. package/dist/node_modules/date-fns/lastDayOfMonth.js +0 -31
  111. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.cjs +0 -9
  112. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -9
  113. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.cjs +0 -51
  114. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -51
  115. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.cjs +0 -28
  116. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -28
  117. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.cjs +0 -19
  118. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -19
  119. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.cjs +0 -76
  120. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -76
  121. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.cjs +0 -32
  122. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -32
  123. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.cjs +0 -12
  124. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -12
  125. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.cjs +0 -211
  126. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -211
  127. package/dist/node_modules/date-fns/locale/en-US/_lib/match.cjs +0 -123
  128. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -124
  129. package/dist/node_modules/date-fns/locale/en-US.cjs +0 -28
  130. package/dist/node_modules/date-fns/locale/en-US.js +0 -28
  131. package/dist/node_modules/date-fns/max.cjs +0 -36
  132. package/dist/node_modules/date-fns/max.js +0 -36
  133. package/dist/node_modules/date-fns/min.cjs +0 -36
  134. package/dist/node_modules/date-fns/min.js +0 -36
  135. package/dist/node_modules/date-fns/setMonth.cjs +0 -37
  136. package/dist/node_modules/date-fns/setMonth.js +0 -37
  137. package/dist/node_modules/date-fns/setYear.cjs +0 -31
  138. package/dist/node_modules/date-fns/setYear.js +0 -31
  139. package/dist/node_modules/date-fns/startOfDay.cjs +0 -29
  140. package/dist/node_modules/date-fns/startOfDay.js +0 -29
  141. package/dist/node_modules/date-fns/startOfISOWeek.cjs +0 -29
  142. package/dist/node_modules/date-fns/startOfISOWeek.js +0 -29
  143. package/dist/node_modules/date-fns/startOfISOWeekYear.cjs +0 -36
  144. package/dist/node_modules/date-fns/startOfISOWeekYear.js +0 -36
  145. package/dist/node_modules/date-fns/startOfMonth.cjs +0 -30
  146. package/dist/node_modules/date-fns/startOfMonth.js +0 -30
  147. package/dist/node_modules/date-fns/startOfWeek.cjs +0 -44
  148. package/dist/node_modules/date-fns/startOfWeek.js +0 -44
  149. package/dist/node_modules/date-fns/startOfWeekYear.cjs +0 -55
  150. package/dist/node_modules/date-fns/startOfWeekYear.js +0 -55
  151. package/dist/node_modules/date-fns/startOfYear.cjs +0 -32
  152. package/dist/node_modules/date-fns/startOfYear.js +0 -32
  153. package/dist/node_modules/date-fns/subDays.cjs +0 -27
  154. package/dist/node_modules/date-fns/subDays.js +0 -27
  155. package/dist/node_modules/date-fns/toDate.cjs +0 -41
  156. package/dist/node_modules/date-fns/toDate.js +0 -41
  157. package/dist/node_modules/react-day-picker/dist/index.esm.cjs +0 -2094
  158. package/dist/node_modules/react-day-picker/dist/index.esm.js +0 -2092
  159. package/skills/redis-ui-components/references/DatePicker.md +0 -52
@@ -1,26 +0,0 @@
1
- const require_toDate = require("./toDate.cjs");
2
- //#region ../../node_modules/date-fns/getUnixTime.mjs
3
- /**
4
- * @name getUnixTime
5
- * @category Timestamp Helpers
6
- * @summary Get the seconds timestamp of the given date.
7
- *
8
- * @description
9
- * Get the seconds timestamp of the given date.
10
- *
11
- * @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).
12
- *
13
- * @param date - The given date
14
- *
15
- * @returns The timestamp
16
- *
17
- * @example
18
- * // Get the timestamp of 29 February 2012 11:45:05 CET:
19
- * const result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5))
20
- * //=> 1330512305
21
- */
22
- function getUnixTime(date) {
23
- return Math.trunc(+require_toDate.default(date) / 1e3);
24
- }
25
- //#endregion
26
- exports.default = getUnixTime;
@@ -1,26 +0,0 @@
1
- import toDate from "./toDate.js";
2
- //#region ../../node_modules/date-fns/getUnixTime.mjs
3
- /**
4
- * @name getUnixTime
5
- * @category Timestamp Helpers
6
- * @summary Get the seconds timestamp of the given date.
7
- *
8
- * @description
9
- * Get the seconds timestamp of the given date.
10
- *
11
- * @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).
12
- *
13
- * @param date - The given date
14
- *
15
- * @returns The timestamp
16
- *
17
- * @example
18
- * // Get the timestamp of 29 February 2012 11:45:05 CET:
19
- * const result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5))
20
- * //=> 1330512305
21
- */
22
- function getUnixTime(date) {
23
- return Math.trunc(+toDate(date) / 1e3);
24
- }
25
- //#endregion
26
- export { getUnixTime as default };
@@ -1,51 +0,0 @@
1
- const require_toDate = require("./toDate.cjs");
2
- const require_constants = require("./constants.cjs");
3
- const require_startOfWeek = require("./startOfWeek.cjs");
4
- const require_startOfWeekYear = require("./startOfWeekYear.cjs");
5
- //#region ../../node_modules/date-fns/getWeek.mjs
6
- /**
7
- * The {@link getWeek} function options.
8
- */
9
- /**
10
- * @name getWeek
11
- * @category Week Helpers
12
- * @summary Get the local week index of the given date.
13
- *
14
- * @description
15
- * Get the local week index of the given date.
16
- * The exact calculation depends on the values of
17
- * `options.weekStartsOn` (which is the index of the first day of the week)
18
- * and `options.firstWeekContainsDate` (which is the day of January, which is always in
19
- * the first week of the week-numbering year)
20
- *
21
- * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
22
- *
23
- * @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).
24
- *
25
- * @param date - The given date
26
- * @param options - An object with options
27
- *
28
- * @returns The week
29
- *
30
- * @example
31
- * // Which week of the local week numbering year is 2 January 2005 with default options?
32
- * const result = getWeek(new Date(2005, 0, 2))
33
- * //=> 2
34
- *
35
- * @example
36
- * // Which week of the local week numbering year is 2 January 2005,
37
- * // if Monday is the first day of the week,
38
- * // and the first week of the year always contains 4 January?
39
- * const result = getWeek(new Date(2005, 0, 2), {
40
- * weekStartsOn: 1,
41
- * firstWeekContainsDate: 4
42
- * })
43
- * //=> 53
44
- */
45
- function getWeek(date, options) {
46
- const _date = require_toDate.default(date);
47
- const diff = +require_startOfWeek.default(_date, options) - +require_startOfWeekYear.default(_date, options);
48
- return Math.round(diff / require_constants.millisecondsInWeek) + 1;
49
- }
50
- //#endregion
51
- exports.default = getWeek;
@@ -1,51 +0,0 @@
1
- import toDate from "./toDate.js";
2
- import { millisecondsInWeek } from "./constants.js";
3
- import startOfWeek from "./startOfWeek.js";
4
- import startOfWeekYear from "./startOfWeekYear.js";
5
- //#region ../../node_modules/date-fns/getWeek.mjs
6
- /**
7
- * The {@link getWeek} function options.
8
- */
9
- /**
10
- * @name getWeek
11
- * @category Week Helpers
12
- * @summary Get the local week index of the given date.
13
- *
14
- * @description
15
- * Get the local week index of the given date.
16
- * The exact calculation depends on the values of
17
- * `options.weekStartsOn` (which is the index of the first day of the week)
18
- * and `options.firstWeekContainsDate` (which is the day of January, which is always in
19
- * the first week of the week-numbering year)
20
- *
21
- * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
22
- *
23
- * @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).
24
- *
25
- * @param date - The given date
26
- * @param options - An object with options
27
- *
28
- * @returns The week
29
- *
30
- * @example
31
- * // Which week of the local week numbering year is 2 January 2005 with default options?
32
- * const result = getWeek(new Date(2005, 0, 2))
33
- * //=> 2
34
- *
35
- * @example
36
- * // Which week of the local week numbering year is 2 January 2005,
37
- * // if Monday is the first day of the week,
38
- * // and the first week of the year always contains 4 January?
39
- * const result = getWeek(new Date(2005, 0, 2), {
40
- * weekStartsOn: 1,
41
- * firstWeekContainsDate: 4
42
- * })
43
- * //=> 53
44
- */
45
- function getWeek(date, options) {
46
- const _date = toDate(date);
47
- const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
48
- return Math.round(diff / millisecondsInWeek) + 1;
49
- }
50
- //#endregion
51
- export { getWeek as default };
@@ -1,63 +0,0 @@
1
- const require_toDate = require("./toDate.cjs");
2
- const require_constructFrom = require("./constructFrom.cjs");
3
- const require_defaultOptions = require("./_lib/defaultOptions.cjs");
4
- const require_startOfWeek = require("./startOfWeek.cjs");
5
- //#region ../../node_modules/date-fns/getWeekYear.mjs
6
- /**
7
- * The {@link getWeekYear} function options.
8
- */
9
- /**
10
- * @name getWeekYear
11
- * @category Week-Numbering Year Helpers
12
- * @summary Get the local week-numbering year of the given date.
13
- *
14
- * @description
15
- * Get the local week-numbering year of the given date.
16
- * The exact calculation depends on the values of
17
- * `options.weekStartsOn` (which is the index of the first day of the week)
18
- * and `options.firstWeekContainsDate` (which is the day of January, which is always in
19
- * the first week of the week-numbering year)
20
- *
21
- * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
22
- *
23
- * @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).
24
- *
25
- * @param date - The given date
26
- * @param options - An object with options.
27
- *
28
- * @returns The local week-numbering year
29
- *
30
- * @example
31
- * // Which week numbering year is 26 December 2004 with the default settings?
32
- * const result = getWeekYear(new Date(2004, 11, 26))
33
- * //=> 2005
34
- *
35
- * @example
36
- * // Which week numbering year is 26 December 2004 if week starts on Saturday?
37
- * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
38
- * //=> 2004
39
- *
40
- * @example
41
- * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
42
- * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
43
- * //=> 2004
44
- */
45
- function getWeekYear(date, options) {
46
- const _date = require_toDate.default(date);
47
- const year = _date.getFullYear();
48
- const defaultOptions = require_defaultOptions.getDefaultOptions();
49
- const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
50
- const firstWeekOfNextYear = require_constructFrom.default(date, 0);
51
- firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
52
- firstWeekOfNextYear.setHours(0, 0, 0, 0);
53
- const startOfNextYear = require_startOfWeek.default(firstWeekOfNextYear, options);
54
- const firstWeekOfThisYear = require_constructFrom.default(date, 0);
55
- firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
56
- firstWeekOfThisYear.setHours(0, 0, 0, 0);
57
- const startOfThisYear = require_startOfWeek.default(firstWeekOfThisYear, options);
58
- if (_date.getTime() >= startOfNextYear.getTime()) return year + 1;
59
- else if (_date.getTime() >= startOfThisYear.getTime()) return year;
60
- else return year - 1;
61
- }
62
- //#endregion
63
- exports.default = getWeekYear;
@@ -1,63 +0,0 @@
1
- import toDate from "./toDate.js";
2
- import constructFrom from "./constructFrom.js";
3
- import { getDefaultOptions } from "./_lib/defaultOptions.js";
4
- import startOfWeek from "./startOfWeek.js";
5
- //#region ../../node_modules/date-fns/getWeekYear.mjs
6
- /**
7
- * The {@link getWeekYear} function options.
8
- */
9
- /**
10
- * @name getWeekYear
11
- * @category Week-Numbering Year Helpers
12
- * @summary Get the local week-numbering year of the given date.
13
- *
14
- * @description
15
- * Get the local week-numbering year of the given date.
16
- * The exact calculation depends on the values of
17
- * `options.weekStartsOn` (which is the index of the first day of the week)
18
- * and `options.firstWeekContainsDate` (which is the day of January, which is always in
19
- * the first week of the week-numbering year)
20
- *
21
- * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
22
- *
23
- * @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).
24
- *
25
- * @param date - The given date
26
- * @param options - An object with options.
27
- *
28
- * @returns The local week-numbering year
29
- *
30
- * @example
31
- * // Which week numbering year is 26 December 2004 with the default settings?
32
- * const result = getWeekYear(new Date(2004, 11, 26))
33
- * //=> 2005
34
- *
35
- * @example
36
- * // Which week numbering year is 26 December 2004 if week starts on Saturday?
37
- * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
38
- * //=> 2004
39
- *
40
- * @example
41
- * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
42
- * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
43
- * //=> 2004
44
- */
45
- function getWeekYear(date, options) {
46
- const _date = toDate(date);
47
- const year = _date.getFullYear();
48
- const defaultOptions = getDefaultOptions();
49
- const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
50
- const firstWeekOfNextYear = constructFrom(date, 0);
51
- firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
52
- firstWeekOfNextYear.setHours(0, 0, 0, 0);
53
- const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
54
- const firstWeekOfThisYear = constructFrom(date, 0);
55
- firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
56
- firstWeekOfThisYear.setHours(0, 0, 0, 0);
57
- const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
58
- if (_date.getTime() >= startOfNextYear.getTime()) return year + 1;
59
- else if (_date.getTime() >= startOfThisYear.getTime()) return year;
60
- else return year - 1;
61
- }
62
- //#endregion
63
- export { getWeekYear as default };
@@ -1,38 +0,0 @@
1
- const require_differenceInCalendarWeeks = require("./differenceInCalendarWeeks.cjs");
2
- const require_startOfMonth = require("./startOfMonth.cjs");
3
- const require_lastDayOfMonth = require("./lastDayOfMonth.cjs");
4
- //#region ../../node_modules/date-fns/getWeeksInMonth.mjs
5
- /**
6
- * The {@link getWeeksInMonth} function options.
7
- */
8
- /**
9
- * @name getWeeksInMonth
10
- * @category Week Helpers
11
- * @summary Get the number of calendar weeks a month spans.
12
- *
13
- * @description
14
- * Get the number of calendar weeks the month in the given date spans.
15
- *
16
- * @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).
17
- *
18
- * @param date - The given date
19
- * @param options - An object with options.
20
- *
21
- * @returns The number of calendar weeks
22
- *
23
- * @example
24
- * // How many calendar weeks does February 2015 span?
25
- * const result = getWeeksInMonth(new Date(2015, 1, 8))
26
- * //=> 4
27
- *
28
- * @example
29
- * // If the week starts on Monday,
30
- * // how many calendar weeks does July 2017 span?
31
- * const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 })
32
- * //=> 6
33
- */
34
- function getWeeksInMonth(date, options) {
35
- return require_differenceInCalendarWeeks.default(require_lastDayOfMonth.default(date), require_startOfMonth.default(date), options) + 1;
36
- }
37
- //#endregion
38
- exports.default = getWeeksInMonth;
@@ -1,38 +0,0 @@
1
- import differenceInCalendarWeeks from "./differenceInCalendarWeeks.js";
2
- import startOfMonth from "./startOfMonth.js";
3
- import lastDayOfMonth from "./lastDayOfMonth.js";
4
- //#region ../../node_modules/date-fns/getWeeksInMonth.mjs
5
- /**
6
- * The {@link getWeeksInMonth} function options.
7
- */
8
- /**
9
- * @name getWeeksInMonth
10
- * @category Week Helpers
11
- * @summary Get the number of calendar weeks a month spans.
12
- *
13
- * @description
14
- * Get the number of calendar weeks the month in the given date spans.
15
- *
16
- * @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).
17
- *
18
- * @param date - The given date
19
- * @param options - An object with options.
20
- *
21
- * @returns The number of calendar weeks
22
- *
23
- * @example
24
- * // How many calendar weeks does February 2015 span?
25
- * const result = getWeeksInMonth(new Date(2015, 1, 8))
26
- * //=> 4
27
- *
28
- * @example
29
- * // If the week starts on Monday,
30
- * // how many calendar weeks does July 2017 span?
31
- * const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 })
32
- * //=> 6
33
- */
34
- function getWeeksInMonth(date, options) {
35
- return differenceInCalendarWeeks(lastDayOfMonth(date), startOfMonth(date), options) + 1;
36
- }
37
- //#endregion
38
- export { getWeeksInMonth as default };
@@ -1,29 +0,0 @@
1
- const require_toDate = require("./toDate.cjs");
2
- //#region ../../node_modules/date-fns/isAfter.mjs
3
- /**
4
- * @name isAfter
5
- * @category Common Helpers
6
- * @summary Is the first date after the second one?
7
- *
8
- * @description
9
- * Is the first date after the second one?
10
- *
11
- * @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).
12
- *
13
- * @param date - The date that should be after the other one to return true
14
- * @param dateToCompare - The date to compare with
15
- *
16
- * @returns The first date is after the second date
17
- *
18
- * @example
19
- * // Is 10 July 1989 after 11 February 1987?
20
- * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
21
- * //=> true
22
- */
23
- function isAfter(date, dateToCompare) {
24
- const _date = require_toDate.default(date);
25
- const _dateToCompare = require_toDate.default(dateToCompare);
26
- return _date.getTime() > _dateToCompare.getTime();
27
- }
28
- //#endregion
29
- exports.default = isAfter;
@@ -1,29 +0,0 @@
1
- import toDate from "./toDate.js";
2
- //#region ../../node_modules/date-fns/isAfter.mjs
3
- /**
4
- * @name isAfter
5
- * @category Common Helpers
6
- * @summary Is the first date after the second one?
7
- *
8
- * @description
9
- * Is the first date after the second one?
10
- *
11
- * @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).
12
- *
13
- * @param date - The date that should be after the other one to return true
14
- * @param dateToCompare - The date to compare with
15
- *
16
- * @returns The first date is after the second date
17
- *
18
- * @example
19
- * // Is 10 July 1989 after 11 February 1987?
20
- * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
21
- * //=> true
22
- */
23
- function isAfter(date, dateToCompare) {
24
- const _date = toDate(date);
25
- const _dateToCompare = toDate(dateToCompare);
26
- return _date.getTime() > _dateToCompare.getTime();
27
- }
28
- //#endregion
29
- export { isAfter as default };
@@ -1,29 +0,0 @@
1
- const require_toDate = require("./toDate.cjs");
2
- //#region ../../node_modules/date-fns/isBefore.mjs
3
- /**
4
- * @name isBefore
5
- * @category Common Helpers
6
- * @summary Is the first date before the second one?
7
- *
8
- * @description
9
- * Is the first date before the second one?
10
- *
11
- * @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).
12
- *
13
- * @param date - The date that should be before the other one to return true
14
- * @param dateToCompare - The date to compare with
15
- *
16
- * @returns The first date is before the second date
17
- *
18
- * @example
19
- * // Is 10 July 1989 before 11 February 1987?
20
- * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
21
- * //=> false
22
- */
23
- function isBefore(date, dateToCompare) {
24
- const _date = require_toDate.default(date);
25
- const _dateToCompare = require_toDate.default(dateToCompare);
26
- return +_date < +_dateToCompare;
27
- }
28
- //#endregion
29
- exports.default = isBefore;
@@ -1,29 +0,0 @@
1
- import toDate from "./toDate.js";
2
- //#region ../../node_modules/date-fns/isBefore.mjs
3
- /**
4
- * @name isBefore
5
- * @category Common Helpers
6
- * @summary Is the first date before the second one?
7
- *
8
- * @description
9
- * Is the first date before the second one?
10
- *
11
- * @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).
12
- *
13
- * @param date - The date that should be before the other one to return true
14
- * @param dateToCompare - The date to compare with
15
- *
16
- * @returns The first date is before the second date
17
- *
18
- * @example
19
- * // Is 10 July 1989 before 11 February 1987?
20
- * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
21
- * //=> false
22
- */
23
- function isBefore(date, dateToCompare) {
24
- const _date = toDate(date);
25
- const _dateToCompare = toDate(dateToCompare);
26
- return +_date < +_dateToCompare;
27
- }
28
- //#endregion
29
- export { isBefore as default };
@@ -1,38 +0,0 @@
1
- //#region ../../node_modules/date-fns/isDate.mjs
2
- /**
3
- * @name isDate
4
- * @category Common Helpers
5
- * @summary Is the given value a date?
6
- *
7
- * @description
8
- * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
9
- *
10
- * @param value - The value to check
11
- *
12
- * @returns True if the given value is a date
13
- *
14
- * @example
15
- * // For a valid date:
16
- * const result = isDate(new Date())
17
- * //=> true
18
- *
19
- * @example
20
- * // For an invalid date:
21
- * const result = isDate(new Date(NaN))
22
- * //=> true
23
- *
24
- * @example
25
- * // For some value:
26
- * const result = isDate('2014-02-31')
27
- * //=> false
28
- *
29
- * @example
30
- * // For an object:
31
- * const result = isDate({})
32
- * //=> false
33
- */
34
- function isDate(value) {
35
- return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
36
- }
37
- //#endregion
38
- exports.default = isDate;
@@ -1,38 +0,0 @@
1
- //#region ../../node_modules/date-fns/isDate.mjs
2
- /**
3
- * @name isDate
4
- * @category Common Helpers
5
- * @summary Is the given value a date?
6
- *
7
- * @description
8
- * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
9
- *
10
- * @param value - The value to check
11
- *
12
- * @returns True if the given value is a date
13
- *
14
- * @example
15
- * // For a valid date:
16
- * const result = isDate(new Date())
17
- * //=> true
18
- *
19
- * @example
20
- * // For an invalid date:
21
- * const result = isDate(new Date(NaN))
22
- * //=> true
23
- *
24
- * @example
25
- * // For some value:
26
- * const result = isDate('2014-02-31')
27
- * //=> false
28
- *
29
- * @example
30
- * // For an object:
31
- * const result = isDate({})
32
- * //=> false
33
- */
34
- function isDate(value) {
35
- return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
36
- }
37
- //#endregion
38
- export { isDate as default };
@@ -1,39 +0,0 @@
1
- const require_startOfDay = require("./startOfDay.cjs");
2
- //#region ../../node_modules/date-fns/isSameDay.mjs
3
- /**
4
- * @name isSameDay
5
- * @category Day Helpers
6
- * @summary Are the given dates in the same day (and year and month)?
7
- *
8
- * @description
9
- * Are the given dates in the same day (and year and month)?
10
- *
11
- * @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).
12
- *
13
- * @param dateLeft - The first date to check
14
- * @param dateRight - The second date to check
15
-
16
- * @returns The dates are in the same day (and year and month)
17
- *
18
- * @example
19
- * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
20
- * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
21
- * //=> true
22
- *
23
- * @example
24
- * // Are 4 September and 4 October in the same day?
25
- * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
26
- * //=> false
27
- *
28
- * @example
29
- * // Are 4 September, 2014 and 4 September, 2015 in the same day?
30
- * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
31
- * //=> false
32
- */
33
- function isSameDay(dateLeft, dateRight) {
34
- const dateLeftStartOfDay = require_startOfDay.default(dateLeft);
35
- const dateRightStartOfDay = require_startOfDay.default(dateRight);
36
- return +dateLeftStartOfDay === +dateRightStartOfDay;
37
- }
38
- //#endregion
39
- exports.default = isSameDay;
@@ -1,39 +0,0 @@
1
- import startOfDay from "./startOfDay.js";
2
- //#region ../../node_modules/date-fns/isSameDay.mjs
3
- /**
4
- * @name isSameDay
5
- * @category Day Helpers
6
- * @summary Are the given dates in the same day (and year and month)?
7
- *
8
- * @description
9
- * Are the given dates in the same day (and year and month)?
10
- *
11
- * @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).
12
- *
13
- * @param dateLeft - The first date to check
14
- * @param dateRight - The second date to check
15
-
16
- * @returns The dates are in the same day (and year and month)
17
- *
18
- * @example
19
- * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
20
- * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
21
- * //=> true
22
- *
23
- * @example
24
- * // Are 4 September and 4 October in the same day?
25
- * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
26
- * //=> false
27
- *
28
- * @example
29
- * // Are 4 September, 2014 and 4 September, 2015 in the same day?
30
- * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
31
- * //=> false
32
- */
33
- function isSameDay(dateLeft, dateRight) {
34
- const dateLeftStartOfDay = startOfDay(dateLeft);
35
- const dateRightStartOfDay = startOfDay(dateRight);
36
- return +dateLeftStartOfDay === +dateRightStartOfDay;
37
- }
38
- //#endregion
39
- export { isSameDay as default };
@@ -1,34 +0,0 @@
1
- const require_toDate = require("./toDate.cjs");
2
- //#region ../../node_modules/date-fns/isSameMonth.mjs
3
- /**
4
- * @name isSameMonth
5
- * @category Month Helpers
6
- * @summary Are the given dates in the same month (and year)?
7
- *
8
- * @description
9
- * Are the given dates in the same month (and year)?
10
- *
11
- * @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).
12
- *
13
- * @param dateLeft - The first date to check
14
- * @param dateRight - The second date to check
15
- *
16
- * @returns The dates are in the same month (and year)
17
- *
18
- * @example
19
- * // Are 2 September 2014 and 25 September 2014 in the same month?
20
- * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
21
- * //=> true
22
- *
23
- * @example
24
- * // Are 2 September 2014 and 25 September 2015 in the same month?
25
- * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
26
- * //=> false
27
- */
28
- function isSameMonth(dateLeft, dateRight) {
29
- const _dateLeft = require_toDate.default(dateLeft);
30
- const _dateRight = require_toDate.default(dateRight);
31
- return _dateLeft.getFullYear() === _dateRight.getFullYear() && _dateLeft.getMonth() === _dateRight.getMonth();
32
- }
33
- //#endregion
34
- exports.default = isSameMonth;