@redis-ui/components 46.1.3 → 47.0.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.
- package/dist/Badge/Badge.cjs +3 -2
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/Badge/Badge.js +4 -2
- package/dist/Toast/Toaster.style.cjs +2 -2
- package/dist/Toast/Toaster.style.js +2 -2
- package/dist/Toast/core/mapping.helpers.cjs +1 -1
- package/dist/Toast/core/mapping.helpers.js +1 -1
- package/dist/index.cjs +1 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.js +2 -4
- package/dist/node_modules/react-loading-skeleton/dist/index.cjs +2 -1
- package/dist/node_modules/react-loading-skeleton/dist/index.js +2 -1
- package/dist/{packages/components/node_modules → node_modules}/react-toastify/dist/react-toastify.esm.cjs +3 -3
- package/dist/{packages/components/node_modules → node_modules}/react-toastify/dist/react-toastify.esm.js +2 -2
- package/package.json +2 -4
- package/skills/redis-ui-components/SKILL.md +0 -1
- package/skills/redis-ui-components/references/Badge.md +18 -0
- package/dist/DatePicker/DatePicker.cjs +0 -32
- package/dist/DatePicker/DatePicker.d.ts +0 -6
- package/dist/DatePicker/DatePicker.js +0 -31
- package/dist/DatePicker/DatePicker.style.cjs +0 -251
- package/dist/DatePicker/DatePicker.style.d.ts +0 -3
- package/dist/DatePicker/DatePicker.style.js +0 -249
- package/dist/DatePicker/DatePicker.types.d.ts +0 -17
- package/dist/DatePicker/DatePicker.types.js +0 -1
- package/dist/DatePicker/DatePicker.utils.cjs +0 -7
- package/dist/DatePicker/DatePicker.utils.d.ts +0 -2
- package/dist/DatePicker/DatePicker.utils.js +0 -6
- package/dist/DatePicker/RangeDatePicker.cjs +0 -30
- package/dist/DatePicker/RangeDatePicker.d.ts +0 -3
- package/dist/DatePicker/RangeDatePicker.js +0 -29
- package/dist/DatePicker/components/CustomDropdown/CustomDropdown.cjs +0 -34
- package/dist/DatePicker/components/CustomDropdown/CustomDropdown.d.ts +0 -3
- package/dist/DatePicker/components/CustomDropdown/CustomDropdown.js +0 -32
- package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.cjs +0 -11
- package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.d.ts +0 -2
- package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.js +0 -10
- package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.cjs +0 -11
- package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.d.ts +0 -2
- package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.js +0 -10
- package/dist/DatePicker/index.d.ts +0 -3
- package/dist/DatePicker/index.js +0 -2
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.cjs +0 -6
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +0 -6
- package/dist/node_modules/date-fns/_lib/defaultOptions.cjs +0 -7
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +0 -7
- package/dist/node_modules/date-fns/_lib/format/formatters.cjs +0 -418
- package/dist/node_modules/date-fns/_lib/format/formatters.js +0 -418
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.cjs +0 -45
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +0 -45
- package/dist/node_modules/date-fns/_lib/format/longFormatters.cjs +0 -45
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +0 -45
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs +0 -21
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -21
- package/dist/node_modules/date-fns/_lib/protectedTokens.cjs +0 -28
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +0 -26
- package/dist/node_modules/date-fns/addDays.cjs +0 -32
- package/dist/node_modules/date-fns/addDays.js +0 -32
- package/dist/node_modules/date-fns/addMonths.cjs +0 -42
- package/dist/node_modules/date-fns/addMonths.js +0 -42
- package/dist/node_modules/date-fns/addWeeks.cjs +0 -27
- package/dist/node_modules/date-fns/addWeeks.js +0 -27
- package/dist/node_modules/date-fns/addYears.cjs +0 -27
- package/dist/node_modules/date-fns/addYears.js +0 -27
- package/dist/node_modules/date-fns/constants.cjs +0 -39
- package/dist/node_modules/date-fns/constants.js +0 -38
- package/dist/node_modules/date-fns/constructFrom.cjs +0 -37
- package/dist/node_modules/date-fns/constructFrom.js +0 -37
- package/dist/node_modules/date-fns/differenceInCalendarDays.cjs +0 -45
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +0 -45
- package/dist/node_modules/date-fns/differenceInCalendarMonths.cjs +0 -34
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +0 -34
- package/dist/node_modules/date-fns/differenceInCalendarWeeks.cjs +0 -50
- package/dist/node_modules/date-fns/differenceInCalendarWeeks.js +0 -50
- package/dist/node_modules/date-fns/endOfISOWeek.cjs +0 -29
- package/dist/node_modules/date-fns/endOfISOWeek.js +0 -29
- package/dist/node_modules/date-fns/endOfMonth.cjs +0 -31
- package/dist/node_modules/date-fns/endOfMonth.js +0 -31
- package/dist/node_modules/date-fns/endOfWeek.cjs +0 -44
- package/dist/node_modules/date-fns/endOfWeek.js +0 -44
- package/dist/node_modules/date-fns/format.cjs +0 -357
- package/dist/node_modules/date-fns/format.js +0 -357
- package/dist/node_modules/date-fns/getDayOfYear.cjs +0 -29
- package/dist/node_modules/date-fns/getDayOfYear.js +0 -29
- package/dist/node_modules/date-fns/getDaysInMonth.cjs +0 -33
- package/dist/node_modules/date-fns/getDaysInMonth.js +0 -33
- package/dist/node_modules/date-fns/getISOWeek.cjs +0 -33
- package/dist/node_modules/date-fns/getISOWeek.js +0 -33
- package/dist/node_modules/date-fns/getISOWeekYear.cjs +0 -43
- package/dist/node_modules/date-fns/getISOWeekYear.js +0 -43
- package/dist/node_modules/date-fns/getUnixTime.cjs +0 -26
- package/dist/node_modules/date-fns/getUnixTime.js +0 -26
- package/dist/node_modules/date-fns/getWeek.cjs +0 -51
- package/dist/node_modules/date-fns/getWeek.js +0 -51
- package/dist/node_modules/date-fns/getWeekYear.cjs +0 -63
- package/dist/node_modules/date-fns/getWeekYear.js +0 -63
- package/dist/node_modules/date-fns/getWeeksInMonth.cjs +0 -38
- package/dist/node_modules/date-fns/getWeeksInMonth.js +0 -38
- package/dist/node_modules/date-fns/isAfter.cjs +0 -29
- package/dist/node_modules/date-fns/isAfter.js +0 -29
- package/dist/node_modules/date-fns/isBefore.cjs +0 -29
- package/dist/node_modules/date-fns/isBefore.js +0 -29
- package/dist/node_modules/date-fns/isDate.cjs +0 -38
- package/dist/node_modules/date-fns/isDate.js +0 -38
- package/dist/node_modules/date-fns/isSameDay.cjs +0 -39
- package/dist/node_modules/date-fns/isSameDay.js +0 -39
- package/dist/node_modules/date-fns/isSameMonth.cjs +0 -34
- package/dist/node_modules/date-fns/isSameMonth.js +0 -34
- package/dist/node_modules/date-fns/isSameYear.cjs +0 -29
- package/dist/node_modules/date-fns/isSameYear.js +0 -29
- package/dist/node_modules/date-fns/isValid.cjs +0 -43
- package/dist/node_modules/date-fns/isValid.js +0 -43
- package/dist/node_modules/date-fns/lastDayOfMonth.cjs +0 -31
- package/dist/node_modules/date-fns/lastDayOfMonth.js +0 -31
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.cjs +0 -9
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -9
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.cjs +0 -51
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -51
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.cjs +0 -28
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -28
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.cjs +0 -19
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -19
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.cjs +0 -76
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -76
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.cjs +0 -32
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -32
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.cjs +0 -12
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -12
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.cjs +0 -211
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -211
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.cjs +0 -123
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -124
- package/dist/node_modules/date-fns/locale/en-US.cjs +0 -28
- package/dist/node_modules/date-fns/locale/en-US.js +0 -28
- package/dist/node_modules/date-fns/max.cjs +0 -36
- package/dist/node_modules/date-fns/max.js +0 -36
- package/dist/node_modules/date-fns/min.cjs +0 -36
- package/dist/node_modules/date-fns/min.js +0 -36
- package/dist/node_modules/date-fns/setMonth.cjs +0 -37
- package/dist/node_modules/date-fns/setMonth.js +0 -37
- package/dist/node_modules/date-fns/setYear.cjs +0 -31
- package/dist/node_modules/date-fns/setYear.js +0 -31
- package/dist/node_modules/date-fns/startOfDay.cjs +0 -29
- package/dist/node_modules/date-fns/startOfDay.js +0 -29
- package/dist/node_modules/date-fns/startOfISOWeek.cjs +0 -29
- package/dist/node_modules/date-fns/startOfISOWeek.js +0 -29
- package/dist/node_modules/date-fns/startOfISOWeekYear.cjs +0 -36
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +0 -36
- package/dist/node_modules/date-fns/startOfMonth.cjs +0 -30
- package/dist/node_modules/date-fns/startOfMonth.js +0 -30
- package/dist/node_modules/date-fns/startOfWeek.cjs +0 -44
- package/dist/node_modules/date-fns/startOfWeek.js +0 -44
- package/dist/node_modules/date-fns/startOfWeekYear.cjs +0 -55
- package/dist/node_modules/date-fns/startOfWeekYear.js +0 -55
- package/dist/node_modules/date-fns/startOfYear.cjs +0 -32
- package/dist/node_modules/date-fns/startOfYear.js +0 -32
- package/dist/node_modules/date-fns/subDays.cjs +0 -27
- package/dist/node_modules/date-fns/subDays.js +0 -27
- package/dist/node_modules/date-fns/toDate.cjs +0 -41
- package/dist/node_modules/date-fns/toDate.js +0 -41
- package/dist/node_modules/react-day-picker/dist/index.esm.cjs +0 -2094
- package/dist/node_modules/react-day-picker/dist/index.esm.js +0 -2092
- package/skills/redis-ui-components/references/DatePicker.md +0 -52
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const require_toDate = require("./toDate.cjs");
|
|
2
|
-
//#region ../../node_modules/date-fns/startOfMonth.mjs
|
|
3
|
-
/**
|
|
4
|
-
* @name startOfMonth
|
|
5
|
-
* @category Month Helpers
|
|
6
|
-
* @summary Return the start of a month for the given date.
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* Return the start of a month for the given date.
|
|
10
|
-
* The result will be in the local timezone.
|
|
11
|
-
*
|
|
12
|
-
* @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).
|
|
13
|
-
*
|
|
14
|
-
* @param date - The original date
|
|
15
|
-
*
|
|
16
|
-
* @returns The start of a month
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // The start of a month for 2 September 2014 11:55:00:
|
|
20
|
-
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
|
21
|
-
* //=> Mon Sep 01 2014 00:00:00
|
|
22
|
-
*/
|
|
23
|
-
function startOfMonth(date) {
|
|
24
|
-
const _date = require_toDate.default(date);
|
|
25
|
-
_date.setDate(1);
|
|
26
|
-
_date.setHours(0, 0, 0, 0);
|
|
27
|
-
return _date;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.default = startOfMonth;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import toDate from "./toDate.js";
|
|
2
|
-
//#region ../../node_modules/date-fns/startOfMonth.mjs
|
|
3
|
-
/**
|
|
4
|
-
* @name startOfMonth
|
|
5
|
-
* @category Month Helpers
|
|
6
|
-
* @summary Return the start of a month for the given date.
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* Return the start of a month for the given date.
|
|
10
|
-
* The result will be in the local timezone.
|
|
11
|
-
*
|
|
12
|
-
* @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).
|
|
13
|
-
*
|
|
14
|
-
* @param date - The original date
|
|
15
|
-
*
|
|
16
|
-
* @returns The start of a month
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // The start of a month for 2 September 2014 11:55:00:
|
|
20
|
-
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
|
21
|
-
* //=> Mon Sep 01 2014 00:00:00
|
|
22
|
-
*/
|
|
23
|
-
function startOfMonth(date) {
|
|
24
|
-
const _date = toDate(date);
|
|
25
|
-
_date.setDate(1);
|
|
26
|
-
_date.setHours(0, 0, 0, 0);
|
|
27
|
-
return _date;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { startOfMonth as default };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const require_toDate = require("./toDate.cjs");
|
|
2
|
-
const require_defaultOptions = require("./_lib/defaultOptions.cjs");
|
|
3
|
-
//#region ../../node_modules/date-fns/startOfWeek.mjs
|
|
4
|
-
/**
|
|
5
|
-
* The {@link startOfWeek} function options.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @name startOfWeek
|
|
9
|
-
* @category Week Helpers
|
|
10
|
-
* @summary Return the start of a week for the given date.
|
|
11
|
-
*
|
|
12
|
-
* @description
|
|
13
|
-
* Return the start of a week for the given date.
|
|
14
|
-
* The result will be in the local timezone.
|
|
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 original date
|
|
19
|
-
* @param options - An object with options
|
|
20
|
-
*
|
|
21
|
-
* @returns The start of a week
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* // The start of a week for 2 September 2014 11:55:00:
|
|
25
|
-
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
|
|
26
|
-
* //=> Sun Aug 31 2014 00:00:00
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
|
|
30
|
-
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
|
|
31
|
-
* //=> Mon Sep 01 2014 00:00:00
|
|
32
|
-
*/
|
|
33
|
-
function startOfWeek(date, options) {
|
|
34
|
-
const defaultOptions = require_defaultOptions.getDefaultOptions();
|
|
35
|
-
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
|
|
36
|
-
const _date = require_toDate.default(date);
|
|
37
|
-
const day = _date.getDay();
|
|
38
|
-
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
39
|
-
_date.setDate(_date.getDate() - diff);
|
|
40
|
-
_date.setHours(0, 0, 0, 0);
|
|
41
|
-
return _date;
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
exports.default = startOfWeek;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import toDate from "./toDate.js";
|
|
2
|
-
import { getDefaultOptions } from "./_lib/defaultOptions.js";
|
|
3
|
-
//#region ../../node_modules/date-fns/startOfWeek.mjs
|
|
4
|
-
/**
|
|
5
|
-
* The {@link startOfWeek} function options.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @name startOfWeek
|
|
9
|
-
* @category Week Helpers
|
|
10
|
-
* @summary Return the start of a week for the given date.
|
|
11
|
-
*
|
|
12
|
-
* @description
|
|
13
|
-
* Return the start of a week for the given date.
|
|
14
|
-
* The result will be in the local timezone.
|
|
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 original date
|
|
19
|
-
* @param options - An object with options
|
|
20
|
-
*
|
|
21
|
-
* @returns The start of a week
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* // The start of a week for 2 September 2014 11:55:00:
|
|
25
|
-
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
|
|
26
|
-
* //=> Sun Aug 31 2014 00:00:00
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
|
|
30
|
-
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
|
|
31
|
-
* //=> Mon Sep 01 2014 00:00:00
|
|
32
|
-
*/
|
|
33
|
-
function startOfWeek(date, options) {
|
|
34
|
-
const defaultOptions = getDefaultOptions();
|
|
35
|
-
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
|
|
36
|
-
const _date = toDate(date);
|
|
37
|
-
const day = _date.getDay();
|
|
38
|
-
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
39
|
-
_date.setDate(_date.getDate() - diff);
|
|
40
|
-
_date.setHours(0, 0, 0, 0);
|
|
41
|
-
return _date;
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
export { startOfWeek as default };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const require_constructFrom = require("./constructFrom.cjs");
|
|
2
|
-
const require_defaultOptions = require("./_lib/defaultOptions.cjs");
|
|
3
|
-
const require_startOfWeek = require("./startOfWeek.cjs");
|
|
4
|
-
const require_getWeekYear = require("./getWeekYear.cjs");
|
|
5
|
-
//#region ../../node_modules/date-fns/startOfWeekYear.mjs
|
|
6
|
-
/**
|
|
7
|
-
* The {@link startOfWeekYear} function options.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @name startOfWeekYear
|
|
11
|
-
* @category Week-Numbering Year Helpers
|
|
12
|
-
* @summary Return the start of a local week-numbering year for the given date.
|
|
13
|
-
*
|
|
14
|
-
* @description
|
|
15
|
-
* Return the start of a local week-numbering year.
|
|
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 original date
|
|
26
|
-
* @param options - An object with options
|
|
27
|
-
*
|
|
28
|
-
* @returns The start of a week-numbering year
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* // The start of an a week-numbering year for 2 July 2005 with default settings:
|
|
32
|
-
* const result = startOfWeekYear(new Date(2005, 6, 2))
|
|
33
|
-
* //=> Sun Dec 26 2004 00:00:00
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* // The start of a week-numbering year for 2 July 2005
|
|
37
|
-
* // if Monday is the first day of week
|
|
38
|
-
* // and 4 January is always in the first week of the year:
|
|
39
|
-
* const result = startOfWeekYear(new Date(2005, 6, 2), {
|
|
40
|
-
* weekStartsOn: 1,
|
|
41
|
-
* firstWeekContainsDate: 4
|
|
42
|
-
* })
|
|
43
|
-
* //=> Mon Jan 03 2005 00:00:00
|
|
44
|
-
*/
|
|
45
|
-
function startOfWeekYear(date, options) {
|
|
46
|
-
const defaultOptions = require_defaultOptions.getDefaultOptions();
|
|
47
|
-
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
|
|
48
|
-
const year = require_getWeekYear.default(date, options);
|
|
49
|
-
const firstWeek = require_constructFrom.default(date, 0);
|
|
50
|
-
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
|
|
51
|
-
firstWeek.setHours(0, 0, 0, 0);
|
|
52
|
-
return require_startOfWeek.default(firstWeek, options);
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
exports.default = startOfWeekYear;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import constructFrom from "./constructFrom.js";
|
|
2
|
-
import { getDefaultOptions } from "./_lib/defaultOptions.js";
|
|
3
|
-
import startOfWeek from "./startOfWeek.js";
|
|
4
|
-
import getWeekYear from "./getWeekYear.js";
|
|
5
|
-
//#region ../../node_modules/date-fns/startOfWeekYear.mjs
|
|
6
|
-
/**
|
|
7
|
-
* The {@link startOfWeekYear} function options.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @name startOfWeekYear
|
|
11
|
-
* @category Week-Numbering Year Helpers
|
|
12
|
-
* @summary Return the start of a local week-numbering year for the given date.
|
|
13
|
-
*
|
|
14
|
-
* @description
|
|
15
|
-
* Return the start of a local week-numbering year.
|
|
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 original date
|
|
26
|
-
* @param options - An object with options
|
|
27
|
-
*
|
|
28
|
-
* @returns The start of a week-numbering year
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* // The start of an a week-numbering year for 2 July 2005 with default settings:
|
|
32
|
-
* const result = startOfWeekYear(new Date(2005, 6, 2))
|
|
33
|
-
* //=> Sun Dec 26 2004 00:00:00
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* // The start of a week-numbering year for 2 July 2005
|
|
37
|
-
* // if Monday is the first day of week
|
|
38
|
-
* // and 4 January is always in the first week of the year:
|
|
39
|
-
* const result = startOfWeekYear(new Date(2005, 6, 2), {
|
|
40
|
-
* weekStartsOn: 1,
|
|
41
|
-
* firstWeekContainsDate: 4
|
|
42
|
-
* })
|
|
43
|
-
* //=> Mon Jan 03 2005 00:00:00
|
|
44
|
-
*/
|
|
45
|
-
function startOfWeekYear(date, options) {
|
|
46
|
-
const defaultOptions = getDefaultOptions();
|
|
47
|
-
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
|
|
48
|
-
const year = getWeekYear(date, options);
|
|
49
|
-
const firstWeek = constructFrom(date, 0);
|
|
50
|
-
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
|
|
51
|
-
firstWeek.setHours(0, 0, 0, 0);
|
|
52
|
-
return startOfWeek(firstWeek, options);
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
export { startOfWeekYear as default };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const require_toDate = require("./toDate.cjs");
|
|
2
|
-
const require_constructFrom = require("./constructFrom.cjs");
|
|
3
|
-
//#region ../../node_modules/date-fns/startOfYear.mjs
|
|
4
|
-
/**
|
|
5
|
-
* @name startOfYear
|
|
6
|
-
* @category Year Helpers
|
|
7
|
-
* @summary Return the start of a year for the given date.
|
|
8
|
-
*
|
|
9
|
-
* @description
|
|
10
|
-
* Return the start of a year for the given date.
|
|
11
|
-
* The result will be in the local timezone.
|
|
12
|
-
*
|
|
13
|
-
* @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).
|
|
14
|
-
*
|
|
15
|
-
* @param date - The original date
|
|
16
|
-
*
|
|
17
|
-
* @returns The start of a year
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* // The start of a year for 2 September 2014 11:55:00:
|
|
21
|
-
* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
|
|
22
|
-
* //=> Wed Jan 01 2014 00:00:00
|
|
23
|
-
*/
|
|
24
|
-
function startOfYear(date) {
|
|
25
|
-
const cleanDate = require_toDate.default(date);
|
|
26
|
-
const _date = require_constructFrom.default(date, 0);
|
|
27
|
-
_date.setFullYear(cleanDate.getFullYear(), 0, 1);
|
|
28
|
-
_date.setHours(0, 0, 0, 0);
|
|
29
|
-
return _date;
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
exports.default = startOfYear;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import toDate from "./toDate.js";
|
|
2
|
-
import constructFrom from "./constructFrom.js";
|
|
3
|
-
//#region ../../node_modules/date-fns/startOfYear.mjs
|
|
4
|
-
/**
|
|
5
|
-
* @name startOfYear
|
|
6
|
-
* @category Year Helpers
|
|
7
|
-
* @summary Return the start of a year for the given date.
|
|
8
|
-
*
|
|
9
|
-
* @description
|
|
10
|
-
* Return the start of a year for the given date.
|
|
11
|
-
* The result will be in the local timezone.
|
|
12
|
-
*
|
|
13
|
-
* @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).
|
|
14
|
-
*
|
|
15
|
-
* @param date - The original date
|
|
16
|
-
*
|
|
17
|
-
* @returns The start of a year
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* // The start of a year for 2 September 2014 11:55:00:
|
|
21
|
-
* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
|
|
22
|
-
* //=> Wed Jan 01 2014 00:00:00
|
|
23
|
-
*/
|
|
24
|
-
function startOfYear(date) {
|
|
25
|
-
const cleanDate = toDate(date);
|
|
26
|
-
const _date = constructFrom(date, 0);
|
|
27
|
-
_date.setFullYear(cleanDate.getFullYear(), 0, 1);
|
|
28
|
-
_date.setHours(0, 0, 0, 0);
|
|
29
|
-
return _date;
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { startOfYear as default };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const require_addDays = require("./addDays.cjs");
|
|
2
|
-
//#region ../../node_modules/date-fns/subDays.mjs
|
|
3
|
-
/**
|
|
4
|
-
* @name subDays
|
|
5
|
-
* @category Day Helpers
|
|
6
|
-
* @summary Subtract the specified number of days from the given date.
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* Subtract the specified number of days from 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 date to be changed
|
|
14
|
-
* @param amount - The amount of days to be subtracted.
|
|
15
|
-
*
|
|
16
|
-
* @returns The new date with the days subtracted
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // Subtract 10 days from 1 September 2014:
|
|
20
|
-
* const result = subDays(new Date(2014, 8, 1), 10)
|
|
21
|
-
* //=> Fri Aug 22 2014 00:00:00
|
|
22
|
-
*/
|
|
23
|
-
function subDays(date, amount) {
|
|
24
|
-
return require_addDays.default(date, -amount);
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
exports.default = subDays;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import addDays from "./addDays.js";
|
|
2
|
-
//#region ../../node_modules/date-fns/subDays.mjs
|
|
3
|
-
/**
|
|
4
|
-
* @name subDays
|
|
5
|
-
* @category Day Helpers
|
|
6
|
-
* @summary Subtract the specified number of days from the given date.
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* Subtract the specified number of days from 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 date to be changed
|
|
14
|
-
* @param amount - The amount of days to be subtracted.
|
|
15
|
-
*
|
|
16
|
-
* @returns The new date with the days subtracted
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // Subtract 10 days from 1 September 2014:
|
|
20
|
-
* const result = subDays(new Date(2014, 8, 1), 10)
|
|
21
|
-
* //=> Fri Aug 22 2014 00:00:00
|
|
22
|
-
*/
|
|
23
|
-
function subDays(date, amount) {
|
|
24
|
-
return addDays(date, -amount);
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { subDays as default };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/toDate.mjs
|
|
2
|
-
/**
|
|
3
|
-
* @name toDate
|
|
4
|
-
* @category Common Helpers
|
|
5
|
-
* @summary Convert the given argument to an instance of Date.
|
|
6
|
-
*
|
|
7
|
-
* @description
|
|
8
|
-
* Convert the given argument to an instance of Date.
|
|
9
|
-
*
|
|
10
|
-
* If the argument is an instance of Date, the function returns its clone.
|
|
11
|
-
*
|
|
12
|
-
* If the argument is a number, it is treated as a timestamp.
|
|
13
|
-
*
|
|
14
|
-
* If the argument is none of the above, the function returns Invalid Date.
|
|
15
|
-
*
|
|
16
|
-
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
17
|
-
*
|
|
18
|
-
* @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).
|
|
19
|
-
*
|
|
20
|
-
* @param argument - The value to convert
|
|
21
|
-
*
|
|
22
|
-
* @returns The parsed date in the local time zone
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* // Clone the date:
|
|
26
|
-
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
27
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* // Convert the timestamp to date:
|
|
31
|
-
* const result = toDate(1392098430000)
|
|
32
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
33
|
-
*/
|
|
34
|
-
function toDate(argument) {
|
|
35
|
-
const argStr = Object.prototype.toString.call(argument);
|
|
36
|
-
if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") return new argument.constructor(+argument);
|
|
37
|
-
else if (typeof argument === "number" || argStr === "[object Number]" || typeof argument === "string" || argStr === "[object String]") return new Date(argument);
|
|
38
|
-
else return /* @__PURE__ */ new Date(NaN);
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
exports.default = toDate;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/date-fns/toDate.mjs
|
|
2
|
-
/**
|
|
3
|
-
* @name toDate
|
|
4
|
-
* @category Common Helpers
|
|
5
|
-
* @summary Convert the given argument to an instance of Date.
|
|
6
|
-
*
|
|
7
|
-
* @description
|
|
8
|
-
* Convert the given argument to an instance of Date.
|
|
9
|
-
*
|
|
10
|
-
* If the argument is an instance of Date, the function returns its clone.
|
|
11
|
-
*
|
|
12
|
-
* If the argument is a number, it is treated as a timestamp.
|
|
13
|
-
*
|
|
14
|
-
* If the argument is none of the above, the function returns Invalid Date.
|
|
15
|
-
*
|
|
16
|
-
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
17
|
-
*
|
|
18
|
-
* @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).
|
|
19
|
-
*
|
|
20
|
-
* @param argument - The value to convert
|
|
21
|
-
*
|
|
22
|
-
* @returns The parsed date in the local time zone
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* // Clone the date:
|
|
26
|
-
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
27
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* // Convert the timestamp to date:
|
|
31
|
-
* const result = toDate(1392098430000)
|
|
32
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
33
|
-
*/
|
|
34
|
-
function toDate(argument) {
|
|
35
|
-
const argStr = Object.prototype.toString.call(argument);
|
|
36
|
-
if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") return new argument.constructor(+argument);
|
|
37
|
-
else if (typeof argument === "number" || argStr === "[object Number]" || typeof argument === "string" || argStr === "[object String]") return new Date(argument);
|
|
38
|
-
else return /* @__PURE__ */ new Date(NaN);
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
export { toDate as default };
|