Spaces:
Configuration error
Configuration error
luigi12345
commited on
Commit
•
6bd9973
1
Parent(s):
fa202cd
30869d6021bee2b189eed73c2384b33a8d32774a5213557812c42d9730fb1c6c
Browse files- workers1/auto3d/node_modules/date-fns/setDefaultOptions.js +75 -0
- workers1/auto3d/node_modules/date-fns/setDefaultOptions.mjs +78 -0
- workers1/auto3d/node_modules/date-fns/setHours.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/setHours.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/setHours.js +29 -0
- workers1/auto3d/node_modules/date-fns/setHours.mjs +30 -0
- workers1/auto3d/node_modules/date-fns/setISODay.d.mts +26 -0
- workers1/auto3d/node_modules/date-fns/setISODay.d.ts +26 -0
- workers1/auto3d/node_modules/date-fns/setISODay.js +34 -0
- workers1/auto3d/node_modules/date-fns/setISODay.mjs +35 -0
- workers1/auto3d/node_modules/date-fns/setISOWeek.d.mts +26 -0
- workers1/auto3d/node_modules/date-fns/setISOWeek.d.ts +26 -0
- workers1/auto3d/node_modules/date-fns/setISOWeek.js +33 -0
- workers1/auto3d/node_modules/date-fns/setISOWeek.mjs +34 -0
- workers1/auto3d/node_modules/date-fns/setISOWeekYear.d.mts +27 -0
- workers1/auto3d/node_modules/date-fns/setISOWeekYear.d.ts +27 -0
- workers1/auto3d/node_modules/date-fns/setISOWeekYear.js +43 -0
- workers1/auto3d/node_modules/date-fns/setISOWeekYear.mjs +41 -0
- workers1/auto3d/node_modules/date-fns/setMilliseconds.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/setMilliseconds.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/setMilliseconds.js +29 -0
- workers1/auto3d/node_modules/date-fns/setMilliseconds.mjs +30 -0
- workers1/auto3d/node_modules/date-fns/setMinutes.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/setMinutes.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/setMinutes.js +29 -0
- workers1/auto3d/node_modules/date-fns/setMinutes.mjs +30 -0
- workers1/auto3d/node_modules/date-fns/setMonth.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/setMonth.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/setMonth.js +40 -0
- workers1/auto3d/node_modules/date-fns/setMonth.mjs +41 -0
- workers1/auto3d/node_modules/date-fns/setQuarter.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/setQuarter.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/setQuarter.js +31 -0
- workers1/auto3d/node_modules/date-fns/setQuarter.mjs +32 -0
- workers1/auto3d/node_modules/date-fns/setSeconds.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/setSeconds.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/setSeconds.js +29 -0
- workers1/auto3d/node_modules/date-fns/setSeconds.mjs +30 -0
- workers1/auto3d/node_modules/date-fns/setWeek.d.mts +54 -0
- workers1/auto3d/node_modules/date-fns/setWeek.d.ts +54 -0
- workers1/auto3d/node_modules/date-fns/setWeek.js +52 -0
- workers1/auto3d/node_modules/date-fns/setWeek.mjs +53 -0
- workers1/auto3d/node_modules/date-fns/setWeekYear.d.mts +55 -0
- workers1/auto3d/node_modules/date-fns/setWeekYear.d.ts +55 -0
- workers1/auto3d/node_modules/date-fns/setWeekYear.js +72 -0
- workers1/auto3d/node_modules/date-fns/setWeekYear.mjs +69 -0
- workers1/auto3d/node_modules/date-fns/setYear.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/setYear.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/setYear.js +36 -0
- workers1/auto3d/node_modules/date-fns/setYear.mjs +37 -0
workers1/auto3d/node_modules/date-fns/setDefaultOptions.js
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setDefaultOptions = setDefaultOptions;
|
3 |
+
|
4 |
+
var _index = require("./_lib/defaultOptions.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name setDefaultOptions
|
8 |
+
* @category Common Helpers
|
9 |
+
* @summary Set default options including locale.
|
10 |
+
* @pure false
|
11 |
+
*
|
12 |
+
* @description
|
13 |
+
* Sets the defaults for
|
14 |
+
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
|
15 |
+
* arguments for all functions.
|
16 |
+
*
|
17 |
+
* @param options - An object with options
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Set global locale:
|
21 |
+
* import { es } from 'date-fns/locale'
|
22 |
+
* setDefaultOptions({ locale: es })
|
23 |
+
* const result = format(new Date(2014, 8, 2), 'PPPP')
|
24 |
+
* //=> 'martes, 2 de septiembre de 2014'
|
25 |
+
*
|
26 |
+
* @example
|
27 |
+
* // Start of the week for 2 September 2014:
|
28 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
29 |
+
* //=> Sun Aug 31 2014 00:00:00
|
30 |
+
*
|
31 |
+
* @example
|
32 |
+
* // Start of the week for 2 September 2014,
|
33 |
+
* // when we set that week starts on Monday by default:
|
34 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
35 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
36 |
+
* //=> Mon Sep 01 2014 00:00:00
|
37 |
+
*
|
38 |
+
* @example
|
39 |
+
* // Manually set options take priority over default options:
|
40 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
41 |
+
* const result = startOfWeek(new Date(2014, 8, 2), { weekStartsOn: 0 })
|
42 |
+
* //=> Sun Aug 31 2014 00:00:00
|
43 |
+
*
|
44 |
+
* @example
|
45 |
+
* // Remove the option by setting it to `undefined`:
|
46 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
47 |
+
* setDefaultOptions({ weekStartsOn: undefined })
|
48 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
49 |
+
* //=> Sun Aug 31 2014 00:00:00
|
50 |
+
*/
|
51 |
+
function setDefaultOptions(options) {
|
52 |
+
const result = {};
|
53 |
+
const defaultOptions = (0, _index.getDefaultOptions)();
|
54 |
+
|
55 |
+
for (const property in defaultOptions) {
|
56 |
+
if (Object.prototype.hasOwnProperty.call(defaultOptions, property)) {
|
57 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
58 |
+
result[property] = defaultOptions[property];
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
for (const property in options) {
|
63 |
+
if (Object.prototype.hasOwnProperty.call(options, property)) {
|
64 |
+
if (options[property] === undefined) {
|
65 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
66 |
+
delete result[property];
|
67 |
+
} else {
|
68 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
69 |
+
result[property] = options[property];
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
(0, _index.setDefaultOptions)(result);
|
75 |
+
}
|
workers1/auto3d/node_modules/date-fns/setDefaultOptions.mjs
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import {
|
2 |
+
getDefaultOptions,
|
3 |
+
setDefaultOptions as setInternalDefaultOptions,
|
4 |
+
} from "./_lib/defaultOptions.mjs";
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name setDefaultOptions
|
8 |
+
* @category Common Helpers
|
9 |
+
* @summary Set default options including locale.
|
10 |
+
* @pure false
|
11 |
+
*
|
12 |
+
* @description
|
13 |
+
* Sets the defaults for
|
14 |
+
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
|
15 |
+
* arguments for all functions.
|
16 |
+
*
|
17 |
+
* @param options - An object with options
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Set global locale:
|
21 |
+
* import { es } from 'date-fns/locale'
|
22 |
+
* setDefaultOptions({ locale: es })
|
23 |
+
* const result = format(new Date(2014, 8, 2), 'PPPP')
|
24 |
+
* //=> 'martes, 2 de septiembre de 2014'
|
25 |
+
*
|
26 |
+
* @example
|
27 |
+
* // Start of the week for 2 September 2014:
|
28 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
29 |
+
* //=> Sun Aug 31 2014 00:00:00
|
30 |
+
*
|
31 |
+
* @example
|
32 |
+
* // Start of the week for 2 September 2014,
|
33 |
+
* // when we set that week starts on Monday by default:
|
34 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
35 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
36 |
+
* //=> Mon Sep 01 2014 00:00:00
|
37 |
+
*
|
38 |
+
* @example
|
39 |
+
* // Manually set options take priority over default options:
|
40 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
41 |
+
* const result = startOfWeek(new Date(2014, 8, 2), { weekStartsOn: 0 })
|
42 |
+
* //=> Sun Aug 31 2014 00:00:00
|
43 |
+
*
|
44 |
+
* @example
|
45 |
+
* // Remove the option by setting it to `undefined`:
|
46 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
47 |
+
* setDefaultOptions({ weekStartsOn: undefined })
|
48 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
49 |
+
* //=> Sun Aug 31 2014 00:00:00
|
50 |
+
*/
|
51 |
+
export function setDefaultOptions(options) {
|
52 |
+
const result = {};
|
53 |
+
const defaultOptions = getDefaultOptions();
|
54 |
+
|
55 |
+
for (const property in defaultOptions) {
|
56 |
+
if (Object.prototype.hasOwnProperty.call(defaultOptions, property)) {
|
57 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
58 |
+
result[property] = defaultOptions[property];
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
for (const property in options) {
|
63 |
+
if (Object.prototype.hasOwnProperty.call(options, property)) {
|
64 |
+
if (options[property] === undefined) {
|
65 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
66 |
+
delete result[property];
|
67 |
+
} else {
|
68 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
69 |
+
result[property] = options[property];
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
setInternalDefaultOptions(result);
|
75 |
+
}
|
76 |
+
|
77 |
+
// Fallback for modularized imports:
|
78 |
+
export default setDefaultOptions;
|
workers1/auto3d/node_modules/date-fns/setHours.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setHours
|
3 |
+
* @category Hour Helpers
|
4 |
+
* @summary Set the hours to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the hours to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param hours - The hours of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the hours set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set 4 hours to 1 September 2014 11:30:00:
|
18 |
+
* const result = setHours(new Date(2014, 8, 1, 11, 30), 4)
|
19 |
+
* //=> Mon Sep 01 2014 04:30:00
|
20 |
+
*/
|
21 |
+
export declare function setHours<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
hours: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setHours.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setHours
|
3 |
+
* @category Hour Helpers
|
4 |
+
* @summary Set the hours to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the hours to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param hours - The hours of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the hours set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set 4 hours to 1 September 2014 11:30:00:
|
18 |
+
* const result = setHours(new Date(2014, 8, 1, 11, 30), 4)
|
19 |
+
* //=> Mon Sep 01 2014 04:30:00
|
20 |
+
*/
|
21 |
+
export declare function setHours<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
hours: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setHours.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setHours = setHours;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name setHours
|
7 |
+
* @category Hour Helpers
|
8 |
+
* @summary Set the hours to the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Set the hours to the given date.
|
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 date to be changed
|
16 |
+
* @param hours - The hours of the new date
|
17 |
+
*
|
18 |
+
* @returns The new date with the hours set
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // Set 4 hours to 1 September 2014 11:30:00:
|
22 |
+
* const result = setHours(new Date(2014, 8, 1, 11, 30), 4)
|
23 |
+
* //=> Mon Sep 01 2014 04:30:00
|
24 |
+
*/
|
25 |
+
function setHours(date, hours) {
|
26 |
+
const _date = (0, _index.toDate)(date);
|
27 |
+
_date.setHours(hours);
|
28 |
+
return _date;
|
29 |
+
}
|
workers1/auto3d/node_modules/date-fns/setHours.mjs
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name setHours
|
5 |
+
* @category Hour Helpers
|
6 |
+
* @summary Set the hours to the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Set the hours to 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 hours - The hours of the new date
|
15 |
+
*
|
16 |
+
* @returns The new date with the hours set
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Set 4 hours to 1 September 2014 11:30:00:
|
20 |
+
* const result = setHours(new Date(2014, 8, 1, 11, 30), 4)
|
21 |
+
* //=> Mon Sep 01 2014 04:30:00
|
22 |
+
*/
|
23 |
+
export function setHours(date, hours) {
|
24 |
+
const _date = toDate(date);
|
25 |
+
_date.setHours(hours);
|
26 |
+
return _date;
|
27 |
+
}
|
28 |
+
|
29 |
+
// Fallback for modularized imports:
|
30 |
+
export default setHours;
|
workers1/auto3d/node_modules/date-fns/setISODay.d.mts
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setISODay
|
3 |
+
* @category Weekday Helpers
|
4 |
+
* @summary Set the day of the ISO week to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the day of the ISO week to the given date.
|
8 |
+
* ISO week starts with Monday.
|
9 |
+
* 7 is the index of Sunday, 1 is the index of Monday etc.
|
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 day - The day of the ISO week of the new date
|
15 |
+
*
|
16 |
+
* @returns The new date with the day of the ISO week set
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Set Sunday to 1 September 2014:
|
20 |
+
* const result = setISODay(new Date(2014, 8, 1), 7)
|
21 |
+
* //=> Sun Sep 07 2014 00:00:00
|
22 |
+
*/
|
23 |
+
export declare function setISODay<DateType extends Date>(
|
24 |
+
date: DateType | number | string,
|
25 |
+
day: number,
|
26 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setISODay.d.ts
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setISODay
|
3 |
+
* @category Weekday Helpers
|
4 |
+
* @summary Set the day of the ISO week to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the day of the ISO week to the given date.
|
8 |
+
* ISO week starts with Monday.
|
9 |
+
* 7 is the index of Sunday, 1 is the index of Monday etc.
|
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 day - The day of the ISO week of the new date
|
15 |
+
*
|
16 |
+
* @returns The new date with the day of the ISO week set
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Set Sunday to 1 September 2014:
|
20 |
+
* const result = setISODay(new Date(2014, 8, 1), 7)
|
21 |
+
* //=> Sun Sep 07 2014 00:00:00
|
22 |
+
*/
|
23 |
+
export declare function setISODay<DateType extends Date>(
|
24 |
+
date: DateType | number | string,
|
25 |
+
day: number,
|
26 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setISODay.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setISODay = setISODay;
|
3 |
+
var _index = require("./addDays.js");
|
4 |
+
var _index2 = require("./getISODay.js");
|
5 |
+
var _index3 = require("./toDate.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @name setISODay
|
9 |
+
* @category Weekday Helpers
|
10 |
+
* @summary Set the day of the ISO week to the given date.
|
11 |
+
*
|
12 |
+
* @description
|
13 |
+
* Set the day of the ISO week to the given date.
|
14 |
+
* ISO week starts with Monday.
|
15 |
+
* 7 is the index of Sunday, 1 is the index of Monday etc.
|
16 |
+
*
|
17 |
+
* @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).
|
18 |
+
*
|
19 |
+
* @param date - The date to be changed
|
20 |
+
* @param day - The day of the ISO week of the new date
|
21 |
+
*
|
22 |
+
* @returns The new date with the day of the ISO week set
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // Set Sunday to 1 September 2014:
|
26 |
+
* const result = setISODay(new Date(2014, 8, 1), 7)
|
27 |
+
* //=> Sun Sep 07 2014 00:00:00
|
28 |
+
*/
|
29 |
+
function setISODay(date, day) {
|
30 |
+
const _date = (0, _index3.toDate)(date);
|
31 |
+
const currentDay = (0, _index2.getISODay)(_date);
|
32 |
+
const diff = day - currentDay;
|
33 |
+
return (0, _index.addDays)(_date, diff);
|
34 |
+
}
|
workers1/auto3d/node_modules/date-fns/setISODay.mjs
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { addDays } from "./addDays.mjs";
|
2 |
+
import { getISODay } from "./getISODay.mjs";
|
3 |
+
import { toDate } from "./toDate.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name setISODay
|
7 |
+
* @category Weekday Helpers
|
8 |
+
* @summary Set the day of the ISO week to the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Set the day of the ISO week to the given date.
|
12 |
+
* ISO week starts with Monday.
|
13 |
+
* 7 is the index of Sunday, 1 is the index of Monday etc.
|
14 |
+
*
|
15 |
+
* @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).
|
16 |
+
*
|
17 |
+
* @param date - The date to be changed
|
18 |
+
* @param day - The day of the ISO week of the new date
|
19 |
+
*
|
20 |
+
* @returns The new date with the day of the ISO week set
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // Set Sunday to 1 September 2014:
|
24 |
+
* const result = setISODay(new Date(2014, 8, 1), 7)
|
25 |
+
* //=> Sun Sep 07 2014 00:00:00
|
26 |
+
*/
|
27 |
+
export function setISODay(date, day) {
|
28 |
+
const _date = toDate(date);
|
29 |
+
const currentDay = getISODay(_date);
|
30 |
+
const diff = day - currentDay;
|
31 |
+
return addDays(_date, diff);
|
32 |
+
}
|
33 |
+
|
34 |
+
// Fallback for modularized imports:
|
35 |
+
export default setISODay;
|
workers1/auto3d/node_modules/date-fns/setISOWeek.d.mts
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setISOWeek
|
3 |
+
* @category ISO Week Helpers
|
4 |
+
* @summary Set the ISO week to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the ISO week to the given date, saving the weekday number.
|
8 |
+
*
|
9 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_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 week - The ISO week of the new date
|
15 |
+
*
|
16 |
+
* @returns The new date with the ISO week set
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Set the 53rd ISO week to 7 August 2004:
|
20 |
+
* const result = setISOWeek(new Date(2004, 7, 7), 53)
|
21 |
+
* //=> Sat Jan 01 2005 00:00:00
|
22 |
+
*/
|
23 |
+
export declare function setISOWeek<DateType extends Date>(
|
24 |
+
date: DateType | number | string,
|
25 |
+
week: number,
|
26 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setISOWeek.d.ts
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setISOWeek
|
3 |
+
* @category ISO Week Helpers
|
4 |
+
* @summary Set the ISO week to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the ISO week to the given date, saving the weekday number.
|
8 |
+
*
|
9 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_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 week - The ISO week of the new date
|
15 |
+
*
|
16 |
+
* @returns The new date with the ISO week set
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Set the 53rd ISO week to 7 August 2004:
|
20 |
+
* const result = setISOWeek(new Date(2004, 7, 7), 53)
|
21 |
+
* //=> Sat Jan 01 2005 00:00:00
|
22 |
+
*/
|
23 |
+
export declare function setISOWeek<DateType extends Date>(
|
24 |
+
date: DateType | number | string,
|
25 |
+
week: number,
|
26 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setISOWeek.js
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setISOWeek = setISOWeek;
|
3 |
+
var _index = require("./getISOWeek.js");
|
4 |
+
var _index2 = require("./toDate.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name setISOWeek
|
8 |
+
* @category ISO Week Helpers
|
9 |
+
* @summary Set the ISO week to the given date.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Set the ISO week to the given date, saving the weekday number.
|
13 |
+
*
|
14 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
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 date to be changed
|
19 |
+
* @param week - The ISO week of the new date
|
20 |
+
*
|
21 |
+
* @returns The new date with the ISO week set
|
22 |
+
*
|
23 |
+
* @example
|
24 |
+
* // Set the 53rd ISO week to 7 August 2004:
|
25 |
+
* const result = setISOWeek(new Date(2004, 7, 7), 53)
|
26 |
+
* //=> Sat Jan 01 2005 00:00:00
|
27 |
+
*/
|
28 |
+
function setISOWeek(date, week) {
|
29 |
+
const _date = (0, _index2.toDate)(date);
|
30 |
+
const diff = (0, _index.getISOWeek)(_date) - week;
|
31 |
+
_date.setDate(_date.getDate() - diff * 7);
|
32 |
+
return _date;
|
33 |
+
}
|
workers1/auto3d/node_modules/date-fns/setISOWeek.mjs
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getISOWeek } from "./getISOWeek.mjs";
|
2 |
+
import { toDate } from "./toDate.mjs";
|
3 |
+
|
4 |
+
/**
|
5 |
+
* @name setISOWeek
|
6 |
+
* @category ISO Week Helpers
|
7 |
+
* @summary Set the ISO week to the given date.
|
8 |
+
*
|
9 |
+
* @description
|
10 |
+
* Set the ISO week to the given date, saving the weekday number.
|
11 |
+
*
|
12 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
13 |
+
*
|
14 |
+
* @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).
|
15 |
+
*
|
16 |
+
* @param date - The date to be changed
|
17 |
+
* @param week - The ISO week of the new date
|
18 |
+
*
|
19 |
+
* @returns The new date with the ISO week set
|
20 |
+
*
|
21 |
+
* @example
|
22 |
+
* // Set the 53rd ISO week to 7 August 2004:
|
23 |
+
* const result = setISOWeek(new Date(2004, 7, 7), 53)
|
24 |
+
* //=> Sat Jan 01 2005 00:00:00
|
25 |
+
*/
|
26 |
+
export function setISOWeek(date, week) {
|
27 |
+
const _date = toDate(date);
|
28 |
+
const diff = getISOWeek(_date) - week;
|
29 |
+
_date.setDate(_date.getDate() - diff * 7);
|
30 |
+
return _date;
|
31 |
+
}
|
32 |
+
|
33 |
+
// Fallback for modularized imports:
|
34 |
+
export default setISOWeek;
|
workers1/auto3d/node_modules/date-fns/setISOWeekYear.d.mts
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setISOWeekYear
|
3 |
+
* @category ISO Week-Numbering Year Helpers
|
4 |
+
* @summary Set the ISO week-numbering year to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the ISO week-numbering year to the given date,
|
8 |
+
* saving the week number and the weekday number.
|
9 |
+
*
|
10 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
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 date to be changed
|
15 |
+
* @param weekYear - The ISO week-numbering year of the new date
|
16 |
+
*
|
17 |
+
* @returns The new date with the ISO week-numbering year set
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Set ISO week-numbering year 2007 to 29 December 2008:
|
21 |
+
* const result = setISOWeekYear(new Date(2008, 11, 29), 2007)
|
22 |
+
* //=> Mon Jan 01 2007 00:00:00
|
23 |
+
*/
|
24 |
+
export declare function setISOWeekYear<DateType extends Date>(
|
25 |
+
date: DateType | number | string,
|
26 |
+
weekYear: number,
|
27 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setISOWeekYear.d.ts
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setISOWeekYear
|
3 |
+
* @category ISO Week-Numbering Year Helpers
|
4 |
+
* @summary Set the ISO week-numbering year to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the ISO week-numbering year to the given date,
|
8 |
+
* saving the week number and the weekday number.
|
9 |
+
*
|
10 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
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 date to be changed
|
15 |
+
* @param weekYear - The ISO week-numbering year of the new date
|
16 |
+
*
|
17 |
+
* @returns The new date with the ISO week-numbering year set
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Set ISO week-numbering year 2007 to 29 December 2008:
|
21 |
+
* const result = setISOWeekYear(new Date(2008, 11, 29), 2007)
|
22 |
+
* //=> Mon Jan 01 2007 00:00:00
|
23 |
+
*/
|
24 |
+
export declare function setISOWeekYear<DateType extends Date>(
|
25 |
+
date: DateType | number | string,
|
26 |
+
weekYear: number,
|
27 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setISOWeekYear.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setISOWeekYear = setISOWeekYear;
|
3 |
+
var _index = require("./constructFrom.js");
|
4 |
+
var _index2 = require("./differenceInCalendarDays.js");
|
5 |
+
var _index3 = require("./startOfISOWeekYear.js");
|
6 |
+
var _index4 = require("./toDate.js");
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @name setISOWeekYear
|
10 |
+
* @category ISO Week-Numbering Year Helpers
|
11 |
+
* @summary Set the ISO week-numbering year to the given date.
|
12 |
+
*
|
13 |
+
* @description
|
14 |
+
* Set the ISO week-numbering year to the given date,
|
15 |
+
* saving the week number and the weekday number.
|
16 |
+
*
|
17 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
18 |
+
*
|
19 |
+
* @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).
|
20 |
+
*
|
21 |
+
* @param date - The date to be changed
|
22 |
+
* @param weekYear - The ISO week-numbering year of the new date
|
23 |
+
*
|
24 |
+
* @returns The new date with the ISO week-numbering year set
|
25 |
+
*
|
26 |
+
* @example
|
27 |
+
* // Set ISO week-numbering year 2007 to 29 December 2008:
|
28 |
+
* const result = setISOWeekYear(new Date(2008, 11, 29), 2007)
|
29 |
+
* //=> Mon Jan 01 2007 00:00:00
|
30 |
+
*/
|
31 |
+
function setISOWeekYear(date, weekYear) {
|
32 |
+
let _date = (0, _index4.toDate)(date);
|
33 |
+
const diff = (0, _index2.differenceInCalendarDays)(
|
34 |
+
_date,
|
35 |
+
(0, _index3.startOfISOWeekYear)(_date),
|
36 |
+
);
|
37 |
+
const fourthOfJanuary = (0, _index.constructFrom)(date, 0);
|
38 |
+
fourthOfJanuary.setFullYear(weekYear, 0, 4);
|
39 |
+
fourthOfJanuary.setHours(0, 0, 0, 0);
|
40 |
+
_date = (0, _index3.startOfISOWeekYear)(fourthOfJanuary);
|
41 |
+
_date.setDate(_date.getDate() + diff);
|
42 |
+
return _date;
|
43 |
+
}
|
workers1/auto3d/node_modules/date-fns/setISOWeekYear.mjs
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { constructFrom } from "./constructFrom.mjs";
|
2 |
+
import { differenceInCalendarDays } from "./differenceInCalendarDays.mjs";
|
3 |
+
import { startOfISOWeekYear } from "./startOfISOWeekYear.mjs";
|
4 |
+
import { toDate } from "./toDate.mjs";
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name setISOWeekYear
|
8 |
+
* @category ISO Week-Numbering Year Helpers
|
9 |
+
* @summary Set the ISO week-numbering year to the given date.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Set the ISO week-numbering year to the given date,
|
13 |
+
* saving the week number and the weekday number.
|
14 |
+
*
|
15 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
16 |
+
*
|
17 |
+
* @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).
|
18 |
+
*
|
19 |
+
* @param date - The date to be changed
|
20 |
+
* @param weekYear - The ISO week-numbering year of the new date
|
21 |
+
*
|
22 |
+
* @returns The new date with the ISO week-numbering year set
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // Set ISO week-numbering year 2007 to 29 December 2008:
|
26 |
+
* const result = setISOWeekYear(new Date(2008, 11, 29), 2007)
|
27 |
+
* //=> Mon Jan 01 2007 00:00:00
|
28 |
+
*/
|
29 |
+
export function setISOWeekYear(date, weekYear) {
|
30 |
+
let _date = toDate(date);
|
31 |
+
const diff = differenceInCalendarDays(_date, startOfISOWeekYear(_date));
|
32 |
+
const fourthOfJanuary = constructFrom(date, 0);
|
33 |
+
fourthOfJanuary.setFullYear(weekYear, 0, 4);
|
34 |
+
fourthOfJanuary.setHours(0, 0, 0, 0);
|
35 |
+
_date = startOfISOWeekYear(fourthOfJanuary);
|
36 |
+
_date.setDate(_date.getDate() + diff);
|
37 |
+
return _date;
|
38 |
+
}
|
39 |
+
|
40 |
+
// Fallback for modularized imports:
|
41 |
+
export default setISOWeekYear;
|
workers1/auto3d/node_modules/date-fns/setMilliseconds.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setMilliseconds
|
3 |
+
* @category Millisecond Helpers
|
4 |
+
* @summary Set the milliseconds to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the milliseconds to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param milliseconds - The milliseconds of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the milliseconds set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set 300 milliseconds to 1 September 2014 11:30:40.500:
|
18 |
+
* const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)
|
19 |
+
* //=> Mon Sep 01 2014 11:30:40.300
|
20 |
+
*/
|
21 |
+
export declare function setMilliseconds<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
milliseconds: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setMilliseconds.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setMilliseconds
|
3 |
+
* @category Millisecond Helpers
|
4 |
+
* @summary Set the milliseconds to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the milliseconds to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param milliseconds - The milliseconds of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the milliseconds set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set 300 milliseconds to 1 September 2014 11:30:40.500:
|
18 |
+
* const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)
|
19 |
+
* //=> Mon Sep 01 2014 11:30:40.300
|
20 |
+
*/
|
21 |
+
export declare function setMilliseconds<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
milliseconds: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setMilliseconds.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setMilliseconds = setMilliseconds;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name setMilliseconds
|
7 |
+
* @category Millisecond Helpers
|
8 |
+
* @summary Set the milliseconds to the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Set the milliseconds to the given date.
|
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 date to be changed
|
16 |
+
* @param milliseconds - The milliseconds of the new date
|
17 |
+
*
|
18 |
+
* @returns The new date with the milliseconds set
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // Set 300 milliseconds to 1 September 2014 11:30:40.500:
|
22 |
+
* const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)
|
23 |
+
* //=> Mon Sep 01 2014 11:30:40.300
|
24 |
+
*/
|
25 |
+
function setMilliseconds(date, milliseconds) {
|
26 |
+
const _date = (0, _index.toDate)(date);
|
27 |
+
_date.setMilliseconds(milliseconds);
|
28 |
+
return _date;
|
29 |
+
}
|
workers1/auto3d/node_modules/date-fns/setMilliseconds.mjs
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name setMilliseconds
|
5 |
+
* @category Millisecond Helpers
|
6 |
+
* @summary Set the milliseconds to the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Set the milliseconds to 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 milliseconds - The milliseconds of the new date
|
15 |
+
*
|
16 |
+
* @returns The new date with the milliseconds set
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Set 300 milliseconds to 1 September 2014 11:30:40.500:
|
20 |
+
* const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)
|
21 |
+
* //=> Mon Sep 01 2014 11:30:40.300
|
22 |
+
*/
|
23 |
+
export function setMilliseconds(date, milliseconds) {
|
24 |
+
const _date = toDate(date);
|
25 |
+
_date.setMilliseconds(milliseconds);
|
26 |
+
return _date;
|
27 |
+
}
|
28 |
+
|
29 |
+
// Fallback for modularized imports:
|
30 |
+
export default setMilliseconds;
|
workers1/auto3d/node_modules/date-fns/setMinutes.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setMinutes
|
3 |
+
* @category Minute Helpers
|
4 |
+
* @summary Set the minutes to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the minutes to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param minutes - The minutes of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the minutes set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set 45 minutes to 1 September 2014 11:30:40:
|
18 |
+
* const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)
|
19 |
+
* //=> Mon Sep 01 2014 11:45:40
|
20 |
+
*/
|
21 |
+
export declare function setMinutes<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
minutes: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setMinutes.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setMinutes
|
3 |
+
* @category Minute Helpers
|
4 |
+
* @summary Set the minutes to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the minutes to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param minutes - The minutes of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the minutes set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set 45 minutes to 1 September 2014 11:30:40:
|
18 |
+
* const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)
|
19 |
+
* //=> Mon Sep 01 2014 11:45:40
|
20 |
+
*/
|
21 |
+
export declare function setMinutes<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
minutes: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setMinutes.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setMinutes = setMinutes;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name setMinutes
|
7 |
+
* @category Minute Helpers
|
8 |
+
* @summary Set the minutes to the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Set the minutes to the given date.
|
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 date to be changed
|
16 |
+
* @param minutes - The minutes of the new date
|
17 |
+
*
|
18 |
+
* @returns The new date with the minutes set
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // Set 45 minutes to 1 September 2014 11:30:40:
|
22 |
+
* const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)
|
23 |
+
* //=> Mon Sep 01 2014 11:45:40
|
24 |
+
*/
|
25 |
+
function setMinutes(date, minutes) {
|
26 |
+
const _date = (0, _index.toDate)(date);
|
27 |
+
_date.setMinutes(minutes);
|
28 |
+
return _date;
|
29 |
+
}
|
workers1/auto3d/node_modules/date-fns/setMinutes.mjs
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name setMinutes
|
5 |
+
* @category Minute Helpers
|
6 |
+
* @summary Set the minutes to the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Set the minutes to 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 minutes - The minutes of the new date
|
15 |
+
*
|
16 |
+
* @returns The new date with the minutes set
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Set 45 minutes to 1 September 2014 11:30:40:
|
20 |
+
* const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)
|
21 |
+
* //=> Mon Sep 01 2014 11:45:40
|
22 |
+
*/
|
23 |
+
export function setMinutes(date, minutes) {
|
24 |
+
const _date = toDate(date);
|
25 |
+
_date.setMinutes(minutes);
|
26 |
+
return _date;
|
27 |
+
}
|
28 |
+
|
29 |
+
// Fallback for modularized imports:
|
30 |
+
export default setMinutes;
|
workers1/auto3d/node_modules/date-fns/setMonth.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setMonth
|
3 |
+
* @category Month Helpers
|
4 |
+
* @summary Set the month to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the month to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param month - The month index to set (0-11)
|
13 |
+
*
|
14 |
+
* @returns The new date with the month set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set February to 1 September 2014:
|
18 |
+
* const result = setMonth(new Date(2014, 8, 1), 1)
|
19 |
+
* //=> Sat Feb 01 2014 00:00:00
|
20 |
+
*/
|
21 |
+
export declare function setMonth<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
month: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setMonth.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setMonth
|
3 |
+
* @category Month Helpers
|
4 |
+
* @summary Set the month to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the month to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param month - The month index to set (0-11)
|
13 |
+
*
|
14 |
+
* @returns The new date with the month set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set February to 1 September 2014:
|
18 |
+
* const result = setMonth(new Date(2014, 8, 1), 1)
|
19 |
+
* //=> Sat Feb 01 2014 00:00:00
|
20 |
+
*/
|
21 |
+
export declare function setMonth<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
month: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setMonth.js
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setMonth = setMonth;
|
3 |
+
var _index = require("./constructFrom.js");
|
4 |
+
var _index2 = require("./getDaysInMonth.js");
|
5 |
+
var _index3 = require("./toDate.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @name setMonth
|
9 |
+
* @category Month Helpers
|
10 |
+
* @summary Set the month to the given date.
|
11 |
+
*
|
12 |
+
* @description
|
13 |
+
* Set the month to the given date.
|
14 |
+
*
|
15 |
+
* @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).
|
16 |
+
*
|
17 |
+
* @param date - The date to be changed
|
18 |
+
* @param month - The month index to set (0-11)
|
19 |
+
*
|
20 |
+
* @returns The new date with the month set
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // Set February to 1 September 2014:
|
24 |
+
* const result = setMonth(new Date(2014, 8, 1), 1)
|
25 |
+
* //=> Sat Feb 01 2014 00:00:00
|
26 |
+
*/
|
27 |
+
function setMonth(date, month) {
|
28 |
+
const _date = (0, _index3.toDate)(date);
|
29 |
+
const year = _date.getFullYear();
|
30 |
+
const day = _date.getDate();
|
31 |
+
|
32 |
+
const dateWithDesiredMonth = (0, _index.constructFrom)(date, 0);
|
33 |
+
dateWithDesiredMonth.setFullYear(year, month, 15);
|
34 |
+
dateWithDesiredMonth.setHours(0, 0, 0, 0);
|
35 |
+
const daysInMonth = (0, _index2.getDaysInMonth)(dateWithDesiredMonth);
|
36 |
+
// Set the last day of the new month
|
37 |
+
// if the original date was the last day of the longer month
|
38 |
+
_date.setMonth(month, Math.min(day, daysInMonth));
|
39 |
+
return _date;
|
40 |
+
}
|
workers1/auto3d/node_modules/date-fns/setMonth.mjs
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { constructFrom } from "./constructFrom.mjs";
|
2 |
+
import { getDaysInMonth } from "./getDaysInMonth.mjs";
|
3 |
+
import { toDate } from "./toDate.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name setMonth
|
7 |
+
* @category Month Helpers
|
8 |
+
* @summary Set the month to the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Set the month to the given date.
|
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 date to be changed
|
16 |
+
* @param month - The month index to set (0-11)
|
17 |
+
*
|
18 |
+
* @returns The new date with the month set
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // Set February to 1 September 2014:
|
22 |
+
* const result = setMonth(new Date(2014, 8, 1), 1)
|
23 |
+
* //=> Sat Feb 01 2014 00:00:00
|
24 |
+
*/
|
25 |
+
export function setMonth(date, month) {
|
26 |
+
const _date = toDate(date);
|
27 |
+
const year = _date.getFullYear();
|
28 |
+
const day = _date.getDate();
|
29 |
+
|
30 |
+
const dateWithDesiredMonth = constructFrom(date, 0);
|
31 |
+
dateWithDesiredMonth.setFullYear(year, month, 15);
|
32 |
+
dateWithDesiredMonth.setHours(0, 0, 0, 0);
|
33 |
+
const daysInMonth = getDaysInMonth(dateWithDesiredMonth);
|
34 |
+
// Set the last day of the new month
|
35 |
+
// if the original date was the last day of the longer month
|
36 |
+
_date.setMonth(month, Math.min(day, daysInMonth));
|
37 |
+
return _date;
|
38 |
+
}
|
39 |
+
|
40 |
+
// Fallback for modularized imports:
|
41 |
+
export default setMonth;
|
workers1/auto3d/node_modules/date-fns/setQuarter.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setQuarter
|
3 |
+
* @category Quarter Helpers
|
4 |
+
* @summary Set the year quarter to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the year quarter to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param quarter - The quarter of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the quarter set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set the 2nd quarter to 2 July 2014:
|
18 |
+
* const result = setQuarter(new Date(2014, 6, 2), 2)
|
19 |
+
* //=> Wed Apr 02 2014 00:00:00
|
20 |
+
*/
|
21 |
+
export declare function setQuarter<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
quarter: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setQuarter.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setQuarter
|
3 |
+
* @category Quarter Helpers
|
4 |
+
* @summary Set the year quarter to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the year quarter to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param quarter - The quarter of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the quarter set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set the 2nd quarter to 2 July 2014:
|
18 |
+
* const result = setQuarter(new Date(2014, 6, 2), 2)
|
19 |
+
* //=> Wed Apr 02 2014 00:00:00
|
20 |
+
*/
|
21 |
+
export declare function setQuarter<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
quarter: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setQuarter.js
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setQuarter = setQuarter;
|
3 |
+
var _index = require("./setMonth.js");
|
4 |
+
var _index2 = require("./toDate.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name setQuarter
|
8 |
+
* @category Quarter Helpers
|
9 |
+
* @summary Set the year quarter to the given date.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Set the year quarter to the given date.
|
13 |
+
*
|
14 |
+
* @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).
|
15 |
+
*
|
16 |
+
* @param date - The date to be changed
|
17 |
+
* @param quarter - The quarter of the new date
|
18 |
+
*
|
19 |
+
* @returns The new date with the quarter set
|
20 |
+
*
|
21 |
+
* @example
|
22 |
+
* // Set the 2nd quarter to 2 July 2014:
|
23 |
+
* const result = setQuarter(new Date(2014, 6, 2), 2)
|
24 |
+
* //=> Wed Apr 02 2014 00:00:00
|
25 |
+
*/
|
26 |
+
function setQuarter(date, quarter) {
|
27 |
+
const _date = (0, _index2.toDate)(date);
|
28 |
+
const oldQuarter = Math.trunc(_date.getMonth() / 3) + 1;
|
29 |
+
const diff = quarter - oldQuarter;
|
30 |
+
return (0, _index.setMonth)(_date, _date.getMonth() + diff * 3);
|
31 |
+
}
|
workers1/auto3d/node_modules/date-fns/setQuarter.mjs
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { setMonth } from "./setMonth.mjs";
|
2 |
+
import { toDate } from "./toDate.mjs";
|
3 |
+
|
4 |
+
/**
|
5 |
+
* @name setQuarter
|
6 |
+
* @category Quarter Helpers
|
7 |
+
* @summary Set the year quarter to the given date.
|
8 |
+
*
|
9 |
+
* @description
|
10 |
+
* Set the year quarter to the given date.
|
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 date to be changed
|
15 |
+
* @param quarter - The quarter of the new date
|
16 |
+
*
|
17 |
+
* @returns The new date with the quarter set
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Set the 2nd quarter to 2 July 2014:
|
21 |
+
* const result = setQuarter(new Date(2014, 6, 2), 2)
|
22 |
+
* //=> Wed Apr 02 2014 00:00:00
|
23 |
+
*/
|
24 |
+
export function setQuarter(date, quarter) {
|
25 |
+
const _date = toDate(date);
|
26 |
+
const oldQuarter = Math.trunc(_date.getMonth() / 3) + 1;
|
27 |
+
const diff = quarter - oldQuarter;
|
28 |
+
return setMonth(_date, _date.getMonth() + diff * 3);
|
29 |
+
}
|
30 |
+
|
31 |
+
// Fallback for modularized imports:
|
32 |
+
export default setQuarter;
|
workers1/auto3d/node_modules/date-fns/setSeconds.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setSeconds
|
3 |
+
* @category Second Helpers
|
4 |
+
* @summary Set the seconds to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the seconds to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param seconds - The seconds of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the seconds set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set 45 seconds to 1 September 2014 11:30:40:
|
18 |
+
* const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)
|
19 |
+
* //=> Mon Sep 01 2014 11:30:45
|
20 |
+
*/
|
21 |
+
export declare function setSeconds<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
seconds: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setSeconds.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setSeconds
|
3 |
+
* @category Second Helpers
|
4 |
+
* @summary Set the seconds to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the seconds to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param seconds - The seconds of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the seconds set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set 45 seconds to 1 September 2014 11:30:40:
|
18 |
+
* const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)
|
19 |
+
* //=> Mon Sep 01 2014 11:30:45
|
20 |
+
*/
|
21 |
+
export declare function setSeconds<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
seconds: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setSeconds.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setSeconds = setSeconds;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name setSeconds
|
7 |
+
* @category Second Helpers
|
8 |
+
* @summary Set the seconds to the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Set the seconds to the given date.
|
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 date to be changed
|
16 |
+
* @param seconds - The seconds of the new date
|
17 |
+
*
|
18 |
+
* @returns The new date with the seconds set
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // Set 45 seconds to 1 September 2014 11:30:40:
|
22 |
+
* const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)
|
23 |
+
* //=> Mon Sep 01 2014 11:30:45
|
24 |
+
*/
|
25 |
+
function setSeconds(date, seconds) {
|
26 |
+
const _date = (0, _index.toDate)(date);
|
27 |
+
_date.setSeconds(seconds);
|
28 |
+
return _date;
|
29 |
+
}
|
workers1/auto3d/node_modules/date-fns/setSeconds.mjs
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name setSeconds
|
5 |
+
* @category Second Helpers
|
6 |
+
* @summary Set the seconds to the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Set the seconds to 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 seconds - The seconds of the new date
|
15 |
+
*
|
16 |
+
* @returns The new date with the seconds set
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Set 45 seconds to 1 September 2014 11:30:40:
|
20 |
+
* const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)
|
21 |
+
* //=> Mon Sep 01 2014 11:30:45
|
22 |
+
*/
|
23 |
+
export function setSeconds(date, seconds) {
|
24 |
+
const _date = toDate(date);
|
25 |
+
_date.setSeconds(seconds);
|
26 |
+
return _date;
|
27 |
+
}
|
28 |
+
|
29 |
+
// Fallback for modularized imports:
|
30 |
+
export default setSeconds;
|
workers1/auto3d/node_modules/date-fns/setWeek.d.mts
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type {
|
2 |
+
FirstWeekContainsDateOptions,
|
3 |
+
LocalizedOptions,
|
4 |
+
WeekOptions,
|
5 |
+
} from "./types.js";
|
6 |
+
/**
|
7 |
+
* The {@link setWeek} function options.
|
8 |
+
*/
|
9 |
+
export interface SetWeekOptions
|
10 |
+
extends LocalizedOptions<"options">,
|
11 |
+
WeekOptions,
|
12 |
+
FirstWeekContainsDateOptions {}
|
13 |
+
/**
|
14 |
+
* @name setWeek
|
15 |
+
* @category Week Helpers
|
16 |
+
* @summary Set the local week to the given date.
|
17 |
+
*
|
18 |
+
* @description
|
19 |
+
* Set the local week to the given date, saving the weekday number.
|
20 |
+
* The exact calculation depends on the values of
|
21 |
+
* `options.weekStartsOn` (which is the index of the first day of the week)
|
22 |
+
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
23 |
+
* the first week of the week-numbering year)
|
24 |
+
*
|
25 |
+
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
26 |
+
*
|
27 |
+
* @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).
|
28 |
+
*
|
29 |
+
* @param date - The date to be changed
|
30 |
+
* @param week - The week of the new date
|
31 |
+
* @param options - An object with options
|
32 |
+
*
|
33 |
+
* @returns The new date with the local week set
|
34 |
+
*
|
35 |
+
* @example
|
36 |
+
* // Set the 1st week to 2 January 2005 with default options:
|
37 |
+
* const result = setWeek(new Date(2005, 0, 2), 1)
|
38 |
+
* //=> Sun Dec 26 2004 00:00:00
|
39 |
+
*
|
40 |
+
* @example
|
41 |
+
* // Set the 1st week to 2 January 2005,
|
42 |
+
* // if Monday is the first day of the week,
|
43 |
+
* // and the first week of the year always contains 4 January:
|
44 |
+
* const result = setWeek(new Date(2005, 0, 2), 1, {
|
45 |
+
* weekStartsOn: 1,
|
46 |
+
* firstWeekContainsDate: 4
|
47 |
+
* })
|
48 |
+
* //=> Sun Jan 4 2004 00:00:00
|
49 |
+
*/
|
50 |
+
export declare function setWeek<DateType extends Date>(
|
51 |
+
date: DateType | number | string,
|
52 |
+
week: number,
|
53 |
+
options?: SetWeekOptions,
|
54 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setWeek.d.ts
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type {
|
2 |
+
FirstWeekContainsDateOptions,
|
3 |
+
LocalizedOptions,
|
4 |
+
WeekOptions,
|
5 |
+
} from "./types.js";
|
6 |
+
/**
|
7 |
+
* The {@link setWeek} function options.
|
8 |
+
*/
|
9 |
+
export interface SetWeekOptions
|
10 |
+
extends LocalizedOptions<"options">,
|
11 |
+
WeekOptions,
|
12 |
+
FirstWeekContainsDateOptions {}
|
13 |
+
/**
|
14 |
+
* @name setWeek
|
15 |
+
* @category Week Helpers
|
16 |
+
* @summary Set the local week to the given date.
|
17 |
+
*
|
18 |
+
* @description
|
19 |
+
* Set the local week to the given date, saving the weekday number.
|
20 |
+
* The exact calculation depends on the values of
|
21 |
+
* `options.weekStartsOn` (which is the index of the first day of the week)
|
22 |
+
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
23 |
+
* the first week of the week-numbering year)
|
24 |
+
*
|
25 |
+
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
26 |
+
*
|
27 |
+
* @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).
|
28 |
+
*
|
29 |
+
* @param date - The date to be changed
|
30 |
+
* @param week - The week of the new date
|
31 |
+
* @param options - An object with options
|
32 |
+
*
|
33 |
+
* @returns The new date with the local week set
|
34 |
+
*
|
35 |
+
* @example
|
36 |
+
* // Set the 1st week to 2 January 2005 with default options:
|
37 |
+
* const result = setWeek(new Date(2005, 0, 2), 1)
|
38 |
+
* //=> Sun Dec 26 2004 00:00:00
|
39 |
+
*
|
40 |
+
* @example
|
41 |
+
* // Set the 1st week to 2 January 2005,
|
42 |
+
* // if Monday is the first day of the week,
|
43 |
+
* // and the first week of the year always contains 4 January:
|
44 |
+
* const result = setWeek(new Date(2005, 0, 2), 1, {
|
45 |
+
* weekStartsOn: 1,
|
46 |
+
* firstWeekContainsDate: 4
|
47 |
+
* })
|
48 |
+
* //=> Sun Jan 4 2004 00:00:00
|
49 |
+
*/
|
50 |
+
export declare function setWeek<DateType extends Date>(
|
51 |
+
date: DateType | number | string,
|
52 |
+
week: number,
|
53 |
+
options?: SetWeekOptions,
|
54 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setWeek.js
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setWeek = setWeek;
|
3 |
+
var _index = require("./getWeek.js");
|
4 |
+
var _index2 = require("./toDate.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* The {@link setWeek} function options.
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* @name setWeek
|
12 |
+
* @category Week Helpers
|
13 |
+
* @summary Set the local week to the given date.
|
14 |
+
*
|
15 |
+
* @description
|
16 |
+
* Set the local week to the given date, saving the weekday number.
|
17 |
+
* The exact calculation depends on the values of
|
18 |
+
* `options.weekStartsOn` (which is the index of the first day of the week)
|
19 |
+
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
20 |
+
* the first week of the week-numbering year)
|
21 |
+
*
|
22 |
+
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
23 |
+
*
|
24 |
+
* @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).
|
25 |
+
*
|
26 |
+
* @param date - The date to be changed
|
27 |
+
* @param week - The week of the new date
|
28 |
+
* @param options - An object with options
|
29 |
+
*
|
30 |
+
* @returns The new date with the local week set
|
31 |
+
*
|
32 |
+
* @example
|
33 |
+
* // Set the 1st week to 2 January 2005 with default options:
|
34 |
+
* const result = setWeek(new Date(2005, 0, 2), 1)
|
35 |
+
* //=> Sun Dec 26 2004 00:00:00
|
36 |
+
*
|
37 |
+
* @example
|
38 |
+
* // Set the 1st week to 2 January 2005,
|
39 |
+
* // if Monday is the first day of the week,
|
40 |
+
* // and the first week of the year always contains 4 January:
|
41 |
+
* const result = setWeek(new Date(2005, 0, 2), 1, {
|
42 |
+
* weekStartsOn: 1,
|
43 |
+
* firstWeekContainsDate: 4
|
44 |
+
* })
|
45 |
+
* //=> Sun Jan 4 2004 00:00:00
|
46 |
+
*/
|
47 |
+
function setWeek(date, week, options) {
|
48 |
+
const _date = (0, _index2.toDate)(date);
|
49 |
+
const diff = (0, _index.getWeek)(_date, options) - week;
|
50 |
+
_date.setDate(_date.getDate() - diff * 7);
|
51 |
+
return _date;
|
52 |
+
}
|
workers1/auto3d/node_modules/date-fns/setWeek.mjs
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getWeek } from "./getWeek.mjs";
|
2 |
+
import { toDate } from "./toDate.mjs";
|
3 |
+
|
4 |
+
/**
|
5 |
+
* The {@link setWeek} function options.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @name setWeek
|
10 |
+
* @category Week Helpers
|
11 |
+
* @summary Set the local week to the given date.
|
12 |
+
*
|
13 |
+
* @description
|
14 |
+
* Set the local week to the given date, saving the weekday number.
|
15 |
+
* The exact calculation depends on the values of
|
16 |
+
* `options.weekStartsOn` (which is the index of the first day of the week)
|
17 |
+
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
18 |
+
* the first week of the week-numbering year)
|
19 |
+
*
|
20 |
+
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
21 |
+
*
|
22 |
+
* @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).
|
23 |
+
*
|
24 |
+
* @param date - The date to be changed
|
25 |
+
* @param week - The week of the new date
|
26 |
+
* @param options - An object with options
|
27 |
+
*
|
28 |
+
* @returns The new date with the local week set
|
29 |
+
*
|
30 |
+
* @example
|
31 |
+
* // Set the 1st week to 2 January 2005 with default options:
|
32 |
+
* const result = setWeek(new Date(2005, 0, 2), 1)
|
33 |
+
* //=> Sun Dec 26 2004 00:00:00
|
34 |
+
*
|
35 |
+
* @example
|
36 |
+
* // Set the 1st week to 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 = setWeek(new Date(2005, 0, 2), 1, {
|
40 |
+
* weekStartsOn: 1,
|
41 |
+
* firstWeekContainsDate: 4
|
42 |
+
* })
|
43 |
+
* //=> Sun Jan 4 2004 00:00:00
|
44 |
+
*/
|
45 |
+
export function setWeek(date, week, options) {
|
46 |
+
const _date = toDate(date);
|
47 |
+
const diff = getWeek(_date, options) - week;
|
48 |
+
_date.setDate(_date.getDate() - diff * 7);
|
49 |
+
return _date;
|
50 |
+
}
|
51 |
+
|
52 |
+
// Fallback for modularized imports:
|
53 |
+
export default setWeek;
|
workers1/auto3d/node_modules/date-fns/setWeekYear.d.mts
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type {
|
2 |
+
FirstWeekContainsDateOptions,
|
3 |
+
LocalizedOptions,
|
4 |
+
WeekOptions,
|
5 |
+
} from "./types.js";
|
6 |
+
/**
|
7 |
+
* The {@link setWeekYear} function options.
|
8 |
+
*/
|
9 |
+
export interface SetWeekYearOptions
|
10 |
+
extends LocalizedOptions<"options">,
|
11 |
+
WeekOptions,
|
12 |
+
FirstWeekContainsDateOptions {}
|
13 |
+
/**
|
14 |
+
* @name setWeekYear
|
15 |
+
* @category Week-Numbering Year Helpers
|
16 |
+
* @summary Set the local week-numbering year to the given date.
|
17 |
+
*
|
18 |
+
* @description
|
19 |
+
* Set the local week-numbering year to the given date,
|
20 |
+
* saving the week number and the weekday number.
|
21 |
+
* The exact calculation depends on the values of
|
22 |
+
* `options.weekStartsOn` (which is the index of the first day of the week)
|
23 |
+
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
24 |
+
* the first week of the week-numbering year)
|
25 |
+
*
|
26 |
+
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
27 |
+
*
|
28 |
+
* @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).
|
29 |
+
*
|
30 |
+
* @param date - The date to be changed
|
31 |
+
* @param weekYear - The local week-numbering year of the new date
|
32 |
+
* @param options - An object with options
|
33 |
+
*
|
34 |
+
* @returns The new date with the local week-numbering year set
|
35 |
+
*
|
36 |
+
* @example
|
37 |
+
* // Set the local week-numbering year 2004 to 2 January 2010 with default options:
|
38 |
+
* const result = setWeekYear(new Date(2010, 0, 2), 2004)
|
39 |
+
* //=> Sat Jan 03 2004 00:00:00
|
40 |
+
*
|
41 |
+
* @example
|
42 |
+
* // Set the local week-numbering year 2004 to 2 January 2010,
|
43 |
+
* // if Monday is the first day of week
|
44 |
+
* // and 4 January is always in the first week of the year:
|
45 |
+
* const result = setWeekYear(new Date(2010, 0, 2), 2004, {
|
46 |
+
* weekStartsOn: 1,
|
47 |
+
* firstWeekContainsDate: 4
|
48 |
+
* })
|
49 |
+
* //=> Sat Jan 01 2005 00:00:00
|
50 |
+
*/
|
51 |
+
export declare function setWeekYear<DateType extends Date>(
|
52 |
+
date: DateType | number | string,
|
53 |
+
weekYear: number,
|
54 |
+
options?: SetWeekYearOptions,
|
55 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setWeekYear.d.ts
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type {
|
2 |
+
FirstWeekContainsDateOptions,
|
3 |
+
LocalizedOptions,
|
4 |
+
WeekOptions,
|
5 |
+
} from "./types.js";
|
6 |
+
/**
|
7 |
+
* The {@link setWeekYear} function options.
|
8 |
+
*/
|
9 |
+
export interface SetWeekYearOptions
|
10 |
+
extends LocalizedOptions<"options">,
|
11 |
+
WeekOptions,
|
12 |
+
FirstWeekContainsDateOptions {}
|
13 |
+
/**
|
14 |
+
* @name setWeekYear
|
15 |
+
* @category Week-Numbering Year Helpers
|
16 |
+
* @summary Set the local week-numbering year to the given date.
|
17 |
+
*
|
18 |
+
* @description
|
19 |
+
* Set the local week-numbering year to the given date,
|
20 |
+
* saving the week number and the weekday number.
|
21 |
+
* The exact calculation depends on the values of
|
22 |
+
* `options.weekStartsOn` (which is the index of the first day of the week)
|
23 |
+
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
24 |
+
* the first week of the week-numbering year)
|
25 |
+
*
|
26 |
+
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
27 |
+
*
|
28 |
+
* @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).
|
29 |
+
*
|
30 |
+
* @param date - The date to be changed
|
31 |
+
* @param weekYear - The local week-numbering year of the new date
|
32 |
+
* @param options - An object with options
|
33 |
+
*
|
34 |
+
* @returns The new date with the local week-numbering year set
|
35 |
+
*
|
36 |
+
* @example
|
37 |
+
* // Set the local week-numbering year 2004 to 2 January 2010 with default options:
|
38 |
+
* const result = setWeekYear(new Date(2010, 0, 2), 2004)
|
39 |
+
* //=> Sat Jan 03 2004 00:00:00
|
40 |
+
*
|
41 |
+
* @example
|
42 |
+
* // Set the local week-numbering year 2004 to 2 January 2010,
|
43 |
+
* // if Monday is the first day of week
|
44 |
+
* // and 4 January is always in the first week of the year:
|
45 |
+
* const result = setWeekYear(new Date(2010, 0, 2), 2004, {
|
46 |
+
* weekStartsOn: 1,
|
47 |
+
* firstWeekContainsDate: 4
|
48 |
+
* })
|
49 |
+
* //=> Sat Jan 01 2005 00:00:00
|
50 |
+
*/
|
51 |
+
export declare function setWeekYear<DateType extends Date>(
|
52 |
+
date: DateType | number | string,
|
53 |
+
weekYear: number,
|
54 |
+
options?: SetWeekYearOptions,
|
55 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setWeekYear.js
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setWeekYear = setWeekYear;
|
3 |
+
var _index = require("./constructFrom.js");
|
4 |
+
var _index2 = require("./differenceInCalendarDays.js");
|
5 |
+
var _index3 = require("./startOfWeekYear.js");
|
6 |
+
var _index4 = require("./toDate.js");
|
7 |
+
|
8 |
+
var _index5 = require("./_lib/defaultOptions.js");
|
9 |
+
|
10 |
+
/**
|
11 |
+
* The {@link setWeekYear} function options.
|
12 |
+
*/
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @name setWeekYear
|
16 |
+
* @category Week-Numbering Year Helpers
|
17 |
+
* @summary Set the local week-numbering year to the given date.
|
18 |
+
*
|
19 |
+
* @description
|
20 |
+
* Set the local week-numbering year to the given date,
|
21 |
+
* saving the week number and the weekday number.
|
22 |
+
* The exact calculation depends on the values of
|
23 |
+
* `options.weekStartsOn` (which is the index of the first day of the week)
|
24 |
+
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
25 |
+
* the first week of the week-numbering year)
|
26 |
+
*
|
27 |
+
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
28 |
+
*
|
29 |
+
* @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).
|
30 |
+
*
|
31 |
+
* @param date - The date to be changed
|
32 |
+
* @param weekYear - The local week-numbering year of the new date
|
33 |
+
* @param options - An object with options
|
34 |
+
*
|
35 |
+
* @returns The new date with the local week-numbering year set
|
36 |
+
*
|
37 |
+
* @example
|
38 |
+
* // Set the local week-numbering year 2004 to 2 January 2010 with default options:
|
39 |
+
* const result = setWeekYear(new Date(2010, 0, 2), 2004)
|
40 |
+
* //=> Sat Jan 03 2004 00:00:00
|
41 |
+
*
|
42 |
+
* @example
|
43 |
+
* // Set the local week-numbering year 2004 to 2 January 2010,
|
44 |
+
* // if Monday is the first day of week
|
45 |
+
* // and 4 January is always in the first week of the year:
|
46 |
+
* const result = setWeekYear(new Date(2010, 0, 2), 2004, {
|
47 |
+
* weekStartsOn: 1,
|
48 |
+
* firstWeekContainsDate: 4
|
49 |
+
* })
|
50 |
+
* //=> Sat Jan 01 2005 00:00:00
|
51 |
+
*/
|
52 |
+
function setWeekYear(date, weekYear, options) {
|
53 |
+
const defaultOptions = (0, _index5.getDefaultOptions)();
|
54 |
+
const firstWeekContainsDate =
|
55 |
+
options?.firstWeekContainsDate ??
|
56 |
+
options?.locale?.options?.firstWeekContainsDate ??
|
57 |
+
defaultOptions.firstWeekContainsDate ??
|
58 |
+
defaultOptions.locale?.options?.firstWeekContainsDate ??
|
59 |
+
1;
|
60 |
+
|
61 |
+
let _date = (0, _index4.toDate)(date);
|
62 |
+
const diff = (0, _index2.differenceInCalendarDays)(
|
63 |
+
_date,
|
64 |
+
(0, _index3.startOfWeekYear)(_date, options),
|
65 |
+
);
|
66 |
+
const firstWeek = (0, _index.constructFrom)(date, 0);
|
67 |
+
firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate);
|
68 |
+
firstWeek.setHours(0, 0, 0, 0);
|
69 |
+
_date = (0, _index3.startOfWeekYear)(firstWeek, options);
|
70 |
+
_date.setDate(_date.getDate() + diff);
|
71 |
+
return _date;
|
72 |
+
}
|
workers1/auto3d/node_modules/date-fns/setWeekYear.mjs
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { constructFrom } from "./constructFrom.mjs";
|
2 |
+
import { differenceInCalendarDays } from "./differenceInCalendarDays.mjs";
|
3 |
+
import { startOfWeekYear } from "./startOfWeekYear.mjs";
|
4 |
+
import { toDate } from "./toDate.mjs";
|
5 |
+
import { getDefaultOptions } from "./_lib/defaultOptions.mjs";
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The {@link setWeekYear} function options.
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @name setWeekYear
|
13 |
+
* @category Week-Numbering Year Helpers
|
14 |
+
* @summary Set the local week-numbering year to the given date.
|
15 |
+
*
|
16 |
+
* @description
|
17 |
+
* Set the local week-numbering year to the given date,
|
18 |
+
* saving the week number and the weekday number.
|
19 |
+
* The exact calculation depends on the values of
|
20 |
+
* `options.weekStartsOn` (which is the index of the first day of the week)
|
21 |
+
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
22 |
+
* the first week of the week-numbering year)
|
23 |
+
*
|
24 |
+
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
25 |
+
*
|
26 |
+
* @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).
|
27 |
+
*
|
28 |
+
* @param date - The date to be changed
|
29 |
+
* @param weekYear - The local week-numbering year of the new date
|
30 |
+
* @param options - An object with options
|
31 |
+
*
|
32 |
+
* @returns The new date with the local week-numbering year set
|
33 |
+
*
|
34 |
+
* @example
|
35 |
+
* // Set the local week-numbering year 2004 to 2 January 2010 with default options:
|
36 |
+
* const result = setWeekYear(new Date(2010, 0, 2), 2004)
|
37 |
+
* //=> Sat Jan 03 2004 00:00:00
|
38 |
+
*
|
39 |
+
* @example
|
40 |
+
* // Set the local week-numbering year 2004 to 2 January 2010,
|
41 |
+
* // if Monday is the first day of week
|
42 |
+
* // and 4 January is always in the first week of the year:
|
43 |
+
* const result = setWeekYear(new Date(2010, 0, 2), 2004, {
|
44 |
+
* weekStartsOn: 1,
|
45 |
+
* firstWeekContainsDate: 4
|
46 |
+
* })
|
47 |
+
* //=> Sat Jan 01 2005 00:00:00
|
48 |
+
*/
|
49 |
+
export function setWeekYear(date, weekYear, options) {
|
50 |
+
const defaultOptions = getDefaultOptions();
|
51 |
+
const firstWeekContainsDate =
|
52 |
+
options?.firstWeekContainsDate ??
|
53 |
+
options?.locale?.options?.firstWeekContainsDate ??
|
54 |
+
defaultOptions.firstWeekContainsDate ??
|
55 |
+
defaultOptions.locale?.options?.firstWeekContainsDate ??
|
56 |
+
1;
|
57 |
+
|
58 |
+
let _date = toDate(date);
|
59 |
+
const diff = differenceInCalendarDays(_date, startOfWeekYear(_date, options));
|
60 |
+
const firstWeek = constructFrom(date, 0);
|
61 |
+
firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate);
|
62 |
+
firstWeek.setHours(0, 0, 0, 0);
|
63 |
+
_date = startOfWeekYear(firstWeek, options);
|
64 |
+
_date.setDate(_date.getDate() + diff);
|
65 |
+
return _date;
|
66 |
+
}
|
67 |
+
|
68 |
+
// Fallback for modularized imports:
|
69 |
+
export default setWeekYear;
|
workers1/auto3d/node_modules/date-fns/setYear.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setYear
|
3 |
+
* @category Year Helpers
|
4 |
+
* @summary Set the year to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the year to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param year - The year of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the year set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set year 2013 to 1 September 2014:
|
18 |
+
* const result = setYear(new Date(2014, 8, 1), 2013)
|
19 |
+
* //=> Sun Sep 01 2013 00:00:00
|
20 |
+
*/
|
21 |
+
export declare function setYear<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
year: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setYear.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setYear
|
3 |
+
* @category Year Helpers
|
4 |
+
* @summary Set the year to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the year to the given date.
|
8 |
+
*
|
9 |
+
* @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).
|
10 |
+
*
|
11 |
+
* @param date - The date to be changed
|
12 |
+
* @param year - The year of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the year set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set year 2013 to 1 September 2014:
|
18 |
+
* const result = setYear(new Date(2014, 8, 1), 2013)
|
19 |
+
* //=> Sun Sep 01 2013 00:00:00
|
20 |
+
*/
|
21 |
+
export declare function setYear<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
year: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setYear.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setYear = setYear;
|
3 |
+
var _index = require("./constructFrom.js");
|
4 |
+
var _index2 = require("./toDate.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name setYear
|
8 |
+
* @category Year Helpers
|
9 |
+
* @summary Set the year to the given date.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Set the year to the given date.
|
13 |
+
*
|
14 |
+
* @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).
|
15 |
+
*
|
16 |
+
* @param date - The date to be changed
|
17 |
+
* @param year - The year of the new date
|
18 |
+
*
|
19 |
+
* @returns The new date with the year set
|
20 |
+
*
|
21 |
+
* @example
|
22 |
+
* // Set year 2013 to 1 September 2014:
|
23 |
+
* const result = setYear(new Date(2014, 8, 1), 2013)
|
24 |
+
* //=> Sun Sep 01 2013 00:00:00
|
25 |
+
*/
|
26 |
+
function setYear(date, year) {
|
27 |
+
const _date = (0, _index2.toDate)(date);
|
28 |
+
|
29 |
+
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
|
30 |
+
if (isNaN(+_date)) {
|
31 |
+
return (0, _index.constructFrom)(date, NaN);
|
32 |
+
}
|
33 |
+
|
34 |
+
_date.setFullYear(year);
|
35 |
+
return _date;
|
36 |
+
}
|
workers1/auto3d/node_modules/date-fns/setYear.mjs
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { constructFrom } from "./constructFrom.mjs";
|
2 |
+
import { toDate } from "./toDate.mjs";
|
3 |
+
|
4 |
+
/**
|
5 |
+
* @name setYear
|
6 |
+
* @category Year Helpers
|
7 |
+
* @summary Set the year to the given date.
|
8 |
+
*
|
9 |
+
* @description
|
10 |
+
* Set the year to the given date.
|
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 date to be changed
|
15 |
+
* @param year - The year of the new date
|
16 |
+
*
|
17 |
+
* @returns The new date with the year set
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Set year 2013 to 1 September 2014:
|
21 |
+
* const result = setYear(new Date(2014, 8, 1), 2013)
|
22 |
+
* //=> Sun Sep 01 2013 00:00:00
|
23 |
+
*/
|
24 |
+
export function setYear(date, year) {
|
25 |
+
const _date = toDate(date);
|
26 |
+
|
27 |
+
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
|
28 |
+
if (isNaN(+_date)) {
|
29 |
+
return constructFrom(date, NaN);
|
30 |
+
}
|
31 |
+
|
32 |
+
_date.setFullYear(year);
|
33 |
+
return _date;
|
34 |
+
}
|
35 |
+
|
36 |
+
// Fallback for modularized imports:
|
37 |
+
export default setYear;
|