Spaces:
Configuration error
Configuration error
luigi12345
commited on
Commit
•
fa202cd
1
Parent(s):
dc8f393
5d069201297a3a0a641d198a02c817a9b43aa1e440317821693c44891b039f65
Browse files- workers1/auto3d/node_modules/date-fns/previousWednesday.d.mts +22 -0
- workers1/auto3d/node_modules/date-fns/previousWednesday.d.ts +22 -0
- workers1/auto3d/node_modules/date-fns/previousWednesday.js +26 -0
- workers1/auto3d/node_modules/date-fns/previousWednesday.mjs +27 -0
- workers1/auto3d/node_modules/date-fns/quartersToMonths.d.mts +20 -0
- workers1/auto3d/node_modules/date-fns/quartersToMonths.d.ts +20 -0
- workers1/auto3d/node_modules/date-fns/quartersToMonths.js +26 -0
- workers1/auto3d/node_modules/date-fns/quartersToMonths.mjs +27 -0
- workers1/auto3d/node_modules/date-fns/quartersToYears.d.mts +25 -0
- workers1/auto3d/node_modules/date-fns/quartersToYears.d.ts +25 -0
- workers1/auto3d/node_modules/date-fns/quartersToYears.js +32 -0
- workers1/auto3d/node_modules/date-fns/quartersToYears.mjs +33 -0
- workers1/auto3d/node_modules/date-fns/roundToNearestHours.d.mts +56 -0
- workers1/auto3d/node_modules/date-fns/roundToNearestHours.d.ts +56 -0
- workers1/auto3d/node_modules/date-fns/roundToNearestHours.js +78 -0
- workers1/auto3d/node_modules/date-fns/roundToNearestHours.mjs +78 -0
- workers1/auto3d/node_modules/date-fns/roundToNearestMinutes.d.mts +51 -0
- workers1/auto3d/node_modules/date-fns/roundToNearestMinutes.d.ts +51 -0
- workers1/auto3d/node_modules/date-fns/roundToNearestMinutes.js +68 -0
- workers1/auto3d/node_modules/date-fns/roundToNearestMinutes.mjs +68 -0
- workers1/auto3d/node_modules/date-fns/secondsToHours.d.mts +23 -0
- workers1/auto3d/node_modules/date-fns/secondsToHours.d.ts +23 -0
- workers1/auto3d/node_modules/date-fns/secondsToHours.js +30 -0
- workers1/auto3d/node_modules/date-fns/secondsToHours.mjs +31 -0
- workers1/auto3d/node_modules/date-fns/secondsToMilliseconds.d.mts +18 -0
- workers1/auto3d/node_modules/date-fns/secondsToMilliseconds.d.ts +18 -0
- workers1/auto3d/node_modules/date-fns/secondsToMilliseconds.js +24 -0
- workers1/auto3d/node_modules/date-fns/secondsToMilliseconds.mjs +25 -0
- workers1/auto3d/node_modules/date-fns/secondsToMinutes.d.mts +23 -0
- workers1/auto3d/node_modules/date-fns/secondsToMinutes.d.ts +23 -0
- workers1/auto3d/node_modules/date-fns/secondsToMinutes.js +30 -0
- workers1/auto3d/node_modules/date-fns/secondsToMinutes.mjs +31 -0
- workers1/auto3d/node_modules/date-fns/set.d.mts +37 -0
- workers1/auto3d/node_modules/date-fns/set.d.ts +37 -0
- workers1/auto3d/node_modules/date-fns/set.js +77 -0
- workers1/auto3d/node_modules/date-fns/set.mjs +78 -0
- workers1/auto3d/node_modules/date-fns/setDate.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/setDate.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/setDate.js +29 -0
- workers1/auto3d/node_modules/date-fns/setDate.mjs +30 -0
- workers1/auto3d/node_modules/date-fns/setDay.d.mts +38 -0
- workers1/auto3d/node_modules/date-fns/setDay.d.ts +38 -0
- workers1/auto3d/node_modules/date-fns/setDay.js +59 -0
- workers1/auto3d/node_modules/date-fns/setDay.mjs +59 -0
- workers1/auto3d/node_modules/date-fns/setDayOfYear.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/setDayOfYear.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/setDayOfYear.js +30 -0
- workers1/auto3d/node_modules/date-fns/setDayOfYear.mjs +31 -0
- workers1/auto3d/node_modules/date-fns/setDefaultOptions.d.mts +47 -0
- workers1/auto3d/node_modules/date-fns/setDefaultOptions.d.ts +47 -0
workers1/auto3d/node_modules/date-fns/previousWednesday.d.mts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name previousWednesday
|
3 |
+
* @category Weekday Helpers
|
4 |
+
* @summary When is the previous Wednesday?
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* When is the previous Wednesday?
|
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 start counting from
|
12 |
+
*
|
13 |
+
* @returns The previous Wednesday
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // When is the previous Wednesday before Jun, 18, 2021?
|
17 |
+
* const result = previousWednesday(new Date(2021, 5, 18))
|
18 |
+
* //=> Wed June 16 2021 00:00:00
|
19 |
+
*/
|
20 |
+
export declare function previousWednesday<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/previousWednesday.d.ts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name previousWednesday
|
3 |
+
* @category Weekday Helpers
|
4 |
+
* @summary When is the previous Wednesday?
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* When is the previous Wednesday?
|
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 start counting from
|
12 |
+
*
|
13 |
+
* @returns The previous Wednesday
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // When is the previous Wednesday before Jun, 18, 2021?
|
17 |
+
* const result = previousWednesday(new Date(2021, 5, 18))
|
18 |
+
* //=> Wed June 16 2021 00:00:00
|
19 |
+
*/
|
20 |
+
export declare function previousWednesday<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/previousWednesday.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.previousWednesday = previousWednesday;
|
3 |
+
var _index = require("./previousDay.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name previousWednesday
|
7 |
+
* @category Weekday Helpers
|
8 |
+
* @summary When is the previous Wednesday?
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* When is the previous Wednesday?
|
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 start counting from
|
16 |
+
*
|
17 |
+
* @returns The previous Wednesday
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // When is the previous Wednesday before Jun, 18, 2021?
|
21 |
+
* const result = previousWednesday(new Date(2021, 5, 18))
|
22 |
+
* //=> Wed June 16 2021 00:00:00
|
23 |
+
*/
|
24 |
+
function previousWednesday(date) {
|
25 |
+
return (0, _index.previousDay)(date, 3);
|
26 |
+
}
|
workers1/auto3d/node_modules/date-fns/previousWednesday.mjs
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { previousDay } from "./previousDay.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name previousWednesday
|
5 |
+
* @category Weekday Helpers
|
6 |
+
* @summary When is the previous Wednesday?
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* When is the previous Wednesday?
|
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 start counting from
|
14 |
+
*
|
15 |
+
* @returns The previous Wednesday
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // When is the previous Wednesday before Jun, 18, 2021?
|
19 |
+
* const result = previousWednesday(new Date(2021, 5, 18))
|
20 |
+
* //=> Wed June 16 2021 00:00:00
|
21 |
+
*/
|
22 |
+
export function previousWednesday(date) {
|
23 |
+
return previousDay(date, 3);
|
24 |
+
}
|
25 |
+
|
26 |
+
// Fallback for modularized imports:
|
27 |
+
export default previousWednesday;
|
workers1/auto3d/node_modules/date-fns/quartersToMonths.d.mts
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name quartersToMonths
|
3 |
+
* @category Conversion Helpers
|
4 |
+
* @summary Convert number of quarters to months.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Convert a number of quarters to a full number of months.
|
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 quarters - The number of quarters to be converted
|
12 |
+
*
|
13 |
+
* @returns The number of quarters converted in months
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Convert 2 quarters to months
|
17 |
+
* const result = quartersToMonths(2)
|
18 |
+
* //=> 6
|
19 |
+
*/
|
20 |
+
export declare function quartersToMonths(quarters: number): number;
|
workers1/auto3d/node_modules/date-fns/quartersToMonths.d.ts
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name quartersToMonths
|
3 |
+
* @category Conversion Helpers
|
4 |
+
* @summary Convert number of quarters to months.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Convert a number of quarters to a full number of months.
|
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 quarters - The number of quarters to be converted
|
12 |
+
*
|
13 |
+
* @returns The number of quarters converted in months
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Convert 2 quarters to months
|
17 |
+
* const result = quartersToMonths(2)
|
18 |
+
* //=> 6
|
19 |
+
*/
|
20 |
+
export declare function quartersToMonths(quarters: number): number;
|
workers1/auto3d/node_modules/date-fns/quartersToMonths.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.quartersToMonths = quartersToMonths;
|
3 |
+
var _index = require("./constants.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name quartersToMonths
|
7 |
+
* @category Conversion Helpers
|
8 |
+
* @summary Convert number of quarters to months.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Convert a number of quarters to a full number of months.
|
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 quarters - The number of quarters to be converted
|
16 |
+
*
|
17 |
+
* @returns The number of quarters converted in months
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Convert 2 quarters to months
|
21 |
+
* const result = quartersToMonths(2)
|
22 |
+
* //=> 6
|
23 |
+
*/
|
24 |
+
function quartersToMonths(quarters) {
|
25 |
+
return Math.trunc(quarters * _index.monthsInQuarter);
|
26 |
+
}
|
workers1/auto3d/node_modules/date-fns/quartersToMonths.mjs
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { monthsInQuarter } from "./constants.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name quartersToMonths
|
5 |
+
* @category Conversion Helpers
|
6 |
+
* @summary Convert number of quarters to months.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Convert a number of quarters to a full number of months.
|
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 quarters - The number of quarters to be converted
|
14 |
+
*
|
15 |
+
* @returns The number of quarters converted in months
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Convert 2 quarters to months
|
19 |
+
* const result = quartersToMonths(2)
|
20 |
+
* //=> 6
|
21 |
+
*/
|
22 |
+
export function quartersToMonths(quarters) {
|
23 |
+
return Math.trunc(quarters * monthsInQuarter);
|
24 |
+
}
|
25 |
+
|
26 |
+
// Fallback for modularized imports:
|
27 |
+
export default quartersToMonths;
|
workers1/auto3d/node_modules/date-fns/quartersToYears.d.mts
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name quartersToYears
|
3 |
+
* @category Conversion Helpers
|
4 |
+
* @summary Convert number of quarters to years.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Convert a number of quarters to a full number of years.
|
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 quarters - The number of quarters to be converted
|
12 |
+
*
|
13 |
+
* @returns The number of quarters converted in years
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Convert 8 quarters to years
|
17 |
+
* const result = quartersToYears(8)
|
18 |
+
* //=> 2
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // It uses floor rounding:
|
22 |
+
* const result = quartersToYears(11)
|
23 |
+
* //=> 2
|
24 |
+
*/
|
25 |
+
export declare function quartersToYears(quarters: number): number;
|
workers1/auto3d/node_modules/date-fns/quartersToYears.d.ts
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name quartersToYears
|
3 |
+
* @category Conversion Helpers
|
4 |
+
* @summary Convert number of quarters to years.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Convert a number of quarters to a full number of years.
|
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 quarters - The number of quarters to be converted
|
12 |
+
*
|
13 |
+
* @returns The number of quarters converted in years
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Convert 8 quarters to years
|
17 |
+
* const result = quartersToYears(8)
|
18 |
+
* //=> 2
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // It uses floor rounding:
|
22 |
+
* const result = quartersToYears(11)
|
23 |
+
* //=> 2
|
24 |
+
*/
|
25 |
+
export declare function quartersToYears(quarters: number): number;
|
workers1/auto3d/node_modules/date-fns/quartersToYears.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.quartersToYears = quartersToYears;
|
3 |
+
var _index = require("./constants.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name quartersToYears
|
7 |
+
* @category Conversion Helpers
|
8 |
+
* @summary Convert number of quarters to years.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Convert a number of quarters to a full number of years.
|
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 quarters - The number of quarters to be converted
|
16 |
+
*
|
17 |
+
* @returns The number of quarters converted in years
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Convert 8 quarters to years
|
21 |
+
* const result = quartersToYears(8)
|
22 |
+
* //=> 2
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // It uses floor rounding:
|
26 |
+
* const result = quartersToYears(11)
|
27 |
+
* //=> 2
|
28 |
+
*/
|
29 |
+
function quartersToYears(quarters) {
|
30 |
+
const years = quarters / _index.quartersInYear;
|
31 |
+
return Math.trunc(years);
|
32 |
+
}
|
workers1/auto3d/node_modules/date-fns/quartersToYears.mjs
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { quartersInYear } from "./constants.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name quartersToYears
|
5 |
+
* @category Conversion Helpers
|
6 |
+
* @summary Convert number of quarters to years.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Convert a number of quarters to a full number of years.
|
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 quarters - The number of quarters to be converted
|
14 |
+
*
|
15 |
+
* @returns The number of quarters converted in years
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Convert 8 quarters to years
|
19 |
+
* const result = quartersToYears(8)
|
20 |
+
* //=> 2
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // It uses floor rounding:
|
24 |
+
* const result = quartersToYears(11)
|
25 |
+
* //=> 2
|
26 |
+
*/
|
27 |
+
export function quartersToYears(quarters) {
|
28 |
+
const years = quarters / quartersInYear;
|
29 |
+
return Math.trunc(years);
|
30 |
+
}
|
31 |
+
|
32 |
+
// Fallback for modularized imports:
|
33 |
+
export default quartersToYears;
|
workers1/auto3d/node_modules/date-fns/roundToNearestHours.d.mts
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type {
|
2 |
+
NearestHours,
|
3 |
+
NearestToUnitOptions,
|
4 |
+
RoundingOptions,
|
5 |
+
} from "./types.js";
|
6 |
+
/**
|
7 |
+
* The {@link roundToNearestHours} function options.
|
8 |
+
*/
|
9 |
+
export interface RoundToNearestHoursOptions
|
10 |
+
extends NearestToUnitOptions<NearestHours>,
|
11 |
+
RoundingOptions {}
|
12 |
+
/**
|
13 |
+
* @name roundToNearestHours
|
14 |
+
* @category Hour Helpers
|
15 |
+
* @summary Rounds the given date to the nearest hour
|
16 |
+
*
|
17 |
+
* @description
|
18 |
+
* Rounds the given date to the nearest hour (or number of hours).
|
19 |
+
* Rounds up when the given date is exactly between the nearest round hours.
|
20 |
+
*
|
21 |
+
* @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).
|
22 |
+
*
|
23 |
+
* @param date - The date to round
|
24 |
+
* @param options - An object with options.
|
25 |
+
*
|
26 |
+
* @returns The new date rounded to the closest hour
|
27 |
+
*
|
28 |
+
* @example
|
29 |
+
* // Round 10 July 2014 12:34:56 to nearest hour:
|
30 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56))
|
31 |
+
* //=> Thu Jul 10 2014 13:00:00
|
32 |
+
*
|
33 |
+
* @example
|
34 |
+
* // Round 10 July 2014 12:34:56 to nearest half hour:
|
35 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 6 })
|
36 |
+
* //=> Thu Jul 10 2014 12:00:00
|
37 |
+
|
38 |
+
* @example
|
39 |
+
* // Round 10 July 2014 12:34:56 to nearest half hour:
|
40 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 8 })
|
41 |
+
* //=> Thu Jul 10 2014 16:00:00
|
42 |
+
|
43 |
+
* @example
|
44 |
+
* // Floor (rounds down) 10 July 2014 12:34:56 to nearest hour:
|
45 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 1, 23, 45), { roundingMethod: 'ceil' })
|
46 |
+
* //=> Thu Jul 10 2014 02:00:00
|
47 |
+
*
|
48 |
+
* @example
|
49 |
+
* // Ceil (rounds up) 10 July 2014 12:34:56 to nearest quarter hour:
|
50 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { roundingMethod: 'floor', nearestTo: 8 })
|
51 |
+
* //=> Thu Jul 10 2014 08:00:00
|
52 |
+
*/
|
53 |
+
export declare function roundToNearestHours<DateType extends Date>(
|
54 |
+
date: DateType | number | string,
|
55 |
+
options?: RoundToNearestHoursOptions,
|
56 |
+
): Date;
|
workers1/auto3d/node_modules/date-fns/roundToNearestHours.d.ts
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type {
|
2 |
+
NearestHours,
|
3 |
+
NearestToUnitOptions,
|
4 |
+
RoundingOptions,
|
5 |
+
} from "./types.js";
|
6 |
+
/**
|
7 |
+
* The {@link roundToNearestHours} function options.
|
8 |
+
*/
|
9 |
+
export interface RoundToNearestHoursOptions
|
10 |
+
extends NearestToUnitOptions<NearestHours>,
|
11 |
+
RoundingOptions {}
|
12 |
+
/**
|
13 |
+
* @name roundToNearestHours
|
14 |
+
* @category Hour Helpers
|
15 |
+
* @summary Rounds the given date to the nearest hour
|
16 |
+
*
|
17 |
+
* @description
|
18 |
+
* Rounds the given date to the nearest hour (or number of hours).
|
19 |
+
* Rounds up when the given date is exactly between the nearest round hours.
|
20 |
+
*
|
21 |
+
* @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).
|
22 |
+
*
|
23 |
+
* @param date - The date to round
|
24 |
+
* @param options - An object with options.
|
25 |
+
*
|
26 |
+
* @returns The new date rounded to the closest hour
|
27 |
+
*
|
28 |
+
* @example
|
29 |
+
* // Round 10 July 2014 12:34:56 to nearest hour:
|
30 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56))
|
31 |
+
* //=> Thu Jul 10 2014 13:00:00
|
32 |
+
*
|
33 |
+
* @example
|
34 |
+
* // Round 10 July 2014 12:34:56 to nearest half hour:
|
35 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 6 })
|
36 |
+
* //=> Thu Jul 10 2014 12:00:00
|
37 |
+
|
38 |
+
* @example
|
39 |
+
* // Round 10 July 2014 12:34:56 to nearest half hour:
|
40 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 8 })
|
41 |
+
* //=> Thu Jul 10 2014 16:00:00
|
42 |
+
|
43 |
+
* @example
|
44 |
+
* // Floor (rounds down) 10 July 2014 12:34:56 to nearest hour:
|
45 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 1, 23, 45), { roundingMethod: 'ceil' })
|
46 |
+
* //=> Thu Jul 10 2014 02:00:00
|
47 |
+
*
|
48 |
+
* @example
|
49 |
+
* // Ceil (rounds up) 10 July 2014 12:34:56 to nearest quarter hour:
|
50 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { roundingMethod: 'floor', nearestTo: 8 })
|
51 |
+
* //=> Thu Jul 10 2014 08:00:00
|
52 |
+
*/
|
53 |
+
export declare function roundToNearestHours<DateType extends Date>(
|
54 |
+
date: DateType | number | string,
|
55 |
+
options?: RoundToNearestHoursOptions,
|
56 |
+
): Date;
|
workers1/auto3d/node_modules/date-fns/roundToNearestHours.js
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.roundToNearestHours = roundToNearestHours;
|
3 |
+
var _index = require("./_lib/getRoundingMethod.js");
|
4 |
+
var _index2 = require("./constructFrom.js");
|
5 |
+
var _index3 = require("./toDate.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The {@link roundToNearestHours} function options.
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @name roundToNearestHours
|
13 |
+
* @category Hour Helpers
|
14 |
+
* @summary Rounds the given date to the nearest hour
|
15 |
+
*
|
16 |
+
* @description
|
17 |
+
* Rounds the given date to the nearest hour (or number of hours).
|
18 |
+
* Rounds up when the given date is exactly between the nearest round hours.
|
19 |
+
*
|
20 |
+
* @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).
|
21 |
+
*
|
22 |
+
* @param date - The date to round
|
23 |
+
* @param options - An object with options.
|
24 |
+
*
|
25 |
+
* @returns The new date rounded to the closest hour
|
26 |
+
*
|
27 |
+
* @example
|
28 |
+
* // Round 10 July 2014 12:34:56 to nearest hour:
|
29 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56))
|
30 |
+
* //=> Thu Jul 10 2014 13:00:00
|
31 |
+
*
|
32 |
+
* @example
|
33 |
+
* // Round 10 July 2014 12:34:56 to nearest half hour:
|
34 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 6 })
|
35 |
+
* //=> Thu Jul 10 2014 12:00:00
|
36 |
+
|
37 |
+
* @example
|
38 |
+
* // Round 10 July 2014 12:34:56 to nearest half hour:
|
39 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 8 })
|
40 |
+
* //=> Thu Jul 10 2014 16:00:00
|
41 |
+
|
42 |
+
* @example
|
43 |
+
* // Floor (rounds down) 10 July 2014 12:34:56 to nearest hour:
|
44 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 1, 23, 45), { roundingMethod: 'ceil' })
|
45 |
+
* //=> Thu Jul 10 2014 02:00:00
|
46 |
+
*
|
47 |
+
* @example
|
48 |
+
* // Ceil (rounds up) 10 July 2014 12:34:56 to nearest quarter hour:
|
49 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { roundingMethod: 'floor', nearestTo: 8 })
|
50 |
+
* //=> Thu Jul 10 2014 08:00:00
|
51 |
+
*/
|
52 |
+
function roundToNearestHours(date, options) {
|
53 |
+
const nearestTo = options?.nearestTo ?? 1;
|
54 |
+
|
55 |
+
if (nearestTo < 1 || nearestTo > 12)
|
56 |
+
return (0, _index2.constructFrom)(date, NaN);
|
57 |
+
|
58 |
+
const _date = (0, _index3.toDate)(date);
|
59 |
+
const fractionalMinutes = _date.getMinutes() / 60;
|
60 |
+
const fractionalSeconds = _date.getSeconds() / 60 / 60;
|
61 |
+
const fractionalMilliseconds = _date.getMilliseconds() / 1000 / 60 / 60;
|
62 |
+
const hours =
|
63 |
+
_date.getHours() +
|
64 |
+
fractionalMinutes +
|
65 |
+
fractionalSeconds +
|
66 |
+
fractionalMilliseconds;
|
67 |
+
|
68 |
+
// Unlike the `differenceIn*` functions, the default rounding behavior is `round` and not 'trunc'
|
69 |
+
const method = options?.roundingMethod ?? "round";
|
70 |
+
const roundingMethod = (0, _index.getRoundingMethod)(method);
|
71 |
+
|
72 |
+
// nearestTo option does not care daylight savings time
|
73 |
+
const roundedHours = roundingMethod(hours / nearestTo) * nearestTo;
|
74 |
+
|
75 |
+
const result = (0, _index2.constructFrom)(date, _date);
|
76 |
+
result.setHours(roundedHours, 0, 0, 0);
|
77 |
+
return result;
|
78 |
+
}
|
workers1/auto3d/node_modules/date-fns/roundToNearestHours.mjs
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getRoundingMethod } from "./_lib/getRoundingMethod.mjs";
|
2 |
+
import { constructFrom } from "./constructFrom.mjs";
|
3 |
+
import { toDate } from "./toDate.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* The {@link roundToNearestHours} function options.
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @name roundToNearestHours
|
11 |
+
* @category Hour Helpers
|
12 |
+
* @summary Rounds the given date to the nearest hour
|
13 |
+
*
|
14 |
+
* @description
|
15 |
+
* Rounds the given date to the nearest hour (or number of hours).
|
16 |
+
* Rounds up when the given date is exactly between the nearest round hours.
|
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 date - The date to round
|
21 |
+
* @param options - An object with options.
|
22 |
+
*
|
23 |
+
* @returns The new date rounded to the closest hour
|
24 |
+
*
|
25 |
+
* @example
|
26 |
+
* // Round 10 July 2014 12:34:56 to nearest hour:
|
27 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56))
|
28 |
+
* //=> Thu Jul 10 2014 13:00:00
|
29 |
+
*
|
30 |
+
* @example
|
31 |
+
* // Round 10 July 2014 12:34:56 to nearest half hour:
|
32 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 6 })
|
33 |
+
* //=> Thu Jul 10 2014 12:00:00
|
34 |
+
|
35 |
+
* @example
|
36 |
+
* // Round 10 July 2014 12:34:56 to nearest half hour:
|
37 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 8 })
|
38 |
+
* //=> Thu Jul 10 2014 16:00:00
|
39 |
+
|
40 |
+
* @example
|
41 |
+
* // Floor (rounds down) 10 July 2014 12:34:56 to nearest hour:
|
42 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 1, 23, 45), { roundingMethod: 'ceil' })
|
43 |
+
* //=> Thu Jul 10 2014 02:00:00
|
44 |
+
*
|
45 |
+
* @example
|
46 |
+
* // Ceil (rounds up) 10 July 2014 12:34:56 to nearest quarter hour:
|
47 |
+
* const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { roundingMethod: 'floor', nearestTo: 8 })
|
48 |
+
* //=> Thu Jul 10 2014 08:00:00
|
49 |
+
*/
|
50 |
+
export function roundToNearestHours(date, options) {
|
51 |
+
const nearestTo = options?.nearestTo ?? 1;
|
52 |
+
|
53 |
+
if (nearestTo < 1 || nearestTo > 12) return constructFrom(date, NaN);
|
54 |
+
|
55 |
+
const _date = toDate(date);
|
56 |
+
const fractionalMinutes = _date.getMinutes() / 60;
|
57 |
+
const fractionalSeconds = _date.getSeconds() / 60 / 60;
|
58 |
+
const fractionalMilliseconds = _date.getMilliseconds() / 1000 / 60 / 60;
|
59 |
+
const hours =
|
60 |
+
_date.getHours() +
|
61 |
+
fractionalMinutes +
|
62 |
+
fractionalSeconds +
|
63 |
+
fractionalMilliseconds;
|
64 |
+
|
65 |
+
// Unlike the `differenceIn*` functions, the default rounding behavior is `round` and not 'trunc'
|
66 |
+
const method = options?.roundingMethod ?? "round";
|
67 |
+
const roundingMethod = getRoundingMethod(method);
|
68 |
+
|
69 |
+
// nearestTo option does not care daylight savings time
|
70 |
+
const roundedHours = roundingMethod(hours / nearestTo) * nearestTo;
|
71 |
+
|
72 |
+
const result = constructFrom(date, _date);
|
73 |
+
result.setHours(roundedHours, 0, 0, 0);
|
74 |
+
return result;
|
75 |
+
}
|
76 |
+
|
77 |
+
// Fallback for modularized imports:
|
78 |
+
export default roundToNearestHours;
|
workers1/auto3d/node_modules/date-fns/roundToNearestMinutes.d.mts
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type {
|
2 |
+
NearestMinutes,
|
3 |
+
NearestToUnitOptions,
|
4 |
+
RoundingOptions,
|
5 |
+
} from "./types.js";
|
6 |
+
/**
|
7 |
+
* The {@link roundToNearestMinutes} function options.
|
8 |
+
*/
|
9 |
+
export interface RoundToNearestMinutesOptions
|
10 |
+
extends NearestToUnitOptions<NearestMinutes>,
|
11 |
+
RoundingOptions {}
|
12 |
+
/**
|
13 |
+
* @name roundToNearestMinutes
|
14 |
+
* @category Minute Helpers
|
15 |
+
* @summary Rounds the given date to the nearest minute
|
16 |
+
*
|
17 |
+
* @description
|
18 |
+
* Rounds the given date to the nearest minute (or number of minutes).
|
19 |
+
* Rounds up when the given date is exactly between the nearest round minutes.
|
20 |
+
*
|
21 |
+
* @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).
|
22 |
+
*
|
23 |
+
* @param date - The date to round
|
24 |
+
* @param options - An object with options.
|
25 |
+
*
|
26 |
+
* @returns The new date rounded to the closest minute
|
27 |
+
*
|
28 |
+
* @example
|
29 |
+
* // Round 10 July 2014 12:12:34 to nearest minute:
|
30 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34))
|
31 |
+
* //=> Thu Jul 10 2014 12:13:00
|
32 |
+
*
|
33 |
+
* @example
|
34 |
+
* // Round 10 July 2014 12:12:34 to nearest quarter hour:
|
35 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 })
|
36 |
+
* //=> Thu Jul 10 2014 12:15:00
|
37 |
+
*
|
38 |
+
* @example
|
39 |
+
* // Floor (rounds down) 10 July 2014 12:12:34 to nearest minute:
|
40 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'floor' })
|
41 |
+
* //=> Thu Jul 10 2014 12:12:00
|
42 |
+
*
|
43 |
+
* @example
|
44 |
+
* // Ceil (rounds up) 10 July 2014 12:12:34 to nearest half hour:
|
45 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'ceil', nearestTo: 30 })
|
46 |
+
* //=> Thu Jul 10 2014 12:30:00
|
47 |
+
*/
|
48 |
+
export declare function roundToNearestMinutes<DateType extends Date>(
|
49 |
+
date: DateType | number | string,
|
50 |
+
options?: RoundToNearestMinutesOptions,
|
51 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/roundToNearestMinutes.d.ts
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type {
|
2 |
+
NearestMinutes,
|
3 |
+
NearestToUnitOptions,
|
4 |
+
RoundingOptions,
|
5 |
+
} from "./types.js";
|
6 |
+
/**
|
7 |
+
* The {@link roundToNearestMinutes} function options.
|
8 |
+
*/
|
9 |
+
export interface RoundToNearestMinutesOptions
|
10 |
+
extends NearestToUnitOptions<NearestMinutes>,
|
11 |
+
RoundingOptions {}
|
12 |
+
/**
|
13 |
+
* @name roundToNearestMinutes
|
14 |
+
* @category Minute Helpers
|
15 |
+
* @summary Rounds the given date to the nearest minute
|
16 |
+
*
|
17 |
+
* @description
|
18 |
+
* Rounds the given date to the nearest minute (or number of minutes).
|
19 |
+
* Rounds up when the given date is exactly between the nearest round minutes.
|
20 |
+
*
|
21 |
+
* @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).
|
22 |
+
*
|
23 |
+
* @param date - The date to round
|
24 |
+
* @param options - An object with options.
|
25 |
+
*
|
26 |
+
* @returns The new date rounded to the closest minute
|
27 |
+
*
|
28 |
+
* @example
|
29 |
+
* // Round 10 July 2014 12:12:34 to nearest minute:
|
30 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34))
|
31 |
+
* //=> Thu Jul 10 2014 12:13:00
|
32 |
+
*
|
33 |
+
* @example
|
34 |
+
* // Round 10 July 2014 12:12:34 to nearest quarter hour:
|
35 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 })
|
36 |
+
* //=> Thu Jul 10 2014 12:15:00
|
37 |
+
*
|
38 |
+
* @example
|
39 |
+
* // Floor (rounds down) 10 July 2014 12:12:34 to nearest minute:
|
40 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'floor' })
|
41 |
+
* //=> Thu Jul 10 2014 12:12:00
|
42 |
+
*
|
43 |
+
* @example
|
44 |
+
* // Ceil (rounds up) 10 July 2014 12:12:34 to nearest half hour:
|
45 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'ceil', nearestTo: 30 })
|
46 |
+
* //=> Thu Jul 10 2014 12:30:00
|
47 |
+
*/
|
48 |
+
export declare function roundToNearestMinutes<DateType extends Date>(
|
49 |
+
date: DateType | number | string,
|
50 |
+
options?: RoundToNearestMinutesOptions,
|
51 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/roundToNearestMinutes.js
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.roundToNearestMinutes = roundToNearestMinutes;
|
3 |
+
var _index = require("./_lib/getRoundingMethod.js");
|
4 |
+
var _index2 = require("./constructFrom.js");
|
5 |
+
var _index3 = require("./toDate.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The {@link roundToNearestMinutes} function options.
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @name roundToNearestMinutes
|
13 |
+
* @category Minute Helpers
|
14 |
+
* @summary Rounds the given date to the nearest minute
|
15 |
+
*
|
16 |
+
* @description
|
17 |
+
* Rounds the given date to the nearest minute (or number of minutes).
|
18 |
+
* Rounds up when the given date is exactly between the nearest round minutes.
|
19 |
+
*
|
20 |
+
* @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).
|
21 |
+
*
|
22 |
+
* @param date - The date to round
|
23 |
+
* @param options - An object with options.
|
24 |
+
*
|
25 |
+
* @returns The new date rounded to the closest minute
|
26 |
+
*
|
27 |
+
* @example
|
28 |
+
* // Round 10 July 2014 12:12:34 to nearest minute:
|
29 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34))
|
30 |
+
* //=> Thu Jul 10 2014 12:13:00
|
31 |
+
*
|
32 |
+
* @example
|
33 |
+
* // Round 10 July 2014 12:12:34 to nearest quarter hour:
|
34 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 })
|
35 |
+
* //=> Thu Jul 10 2014 12:15:00
|
36 |
+
*
|
37 |
+
* @example
|
38 |
+
* // Floor (rounds down) 10 July 2014 12:12:34 to nearest minute:
|
39 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'floor' })
|
40 |
+
* //=> Thu Jul 10 2014 12:12:00
|
41 |
+
*
|
42 |
+
* @example
|
43 |
+
* // Ceil (rounds up) 10 July 2014 12:12:34 to nearest half hour:
|
44 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'ceil', nearestTo: 30 })
|
45 |
+
* //=> Thu Jul 10 2014 12:30:00
|
46 |
+
*/
|
47 |
+
function roundToNearestMinutes(date, options) {
|
48 |
+
const nearestTo = options?.nearestTo ?? 1;
|
49 |
+
|
50 |
+
if (nearestTo < 1 || nearestTo > 30)
|
51 |
+
return (0, _index2.constructFrom)(date, NaN);
|
52 |
+
|
53 |
+
const _date = (0, _index3.toDate)(date);
|
54 |
+
const fractionalSeconds = _date.getSeconds() / 60;
|
55 |
+
const fractionalMilliseconds = _date.getMilliseconds() / 1000 / 60;
|
56 |
+
const minutes =
|
57 |
+
_date.getMinutes() + fractionalSeconds + fractionalMilliseconds;
|
58 |
+
|
59 |
+
// Unlike the `differenceIn*` functions, the default rounding behavior is `round` and not 'trunc'
|
60 |
+
const method = options?.roundingMethod ?? "round";
|
61 |
+
const roundingMethod = (0, _index.getRoundingMethod)(method);
|
62 |
+
|
63 |
+
const roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo;
|
64 |
+
|
65 |
+
const result = (0, _index2.constructFrom)(date, _date);
|
66 |
+
result.setMinutes(roundedMinutes, 0, 0);
|
67 |
+
return result;
|
68 |
+
}
|
workers1/auto3d/node_modules/date-fns/roundToNearestMinutes.mjs
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getRoundingMethod } from "./_lib/getRoundingMethod.mjs";
|
2 |
+
import { constructFrom } from "./constructFrom.mjs";
|
3 |
+
import { toDate } from "./toDate.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* The {@link roundToNearestMinutes} function options.
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @name roundToNearestMinutes
|
11 |
+
* @category Minute Helpers
|
12 |
+
* @summary Rounds the given date to the nearest minute
|
13 |
+
*
|
14 |
+
* @description
|
15 |
+
* Rounds the given date to the nearest minute (or number of minutes).
|
16 |
+
* Rounds up when the given date is exactly between the nearest round minutes.
|
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 date - The date to round
|
21 |
+
* @param options - An object with options.
|
22 |
+
*
|
23 |
+
* @returns The new date rounded to the closest minute
|
24 |
+
*
|
25 |
+
* @example
|
26 |
+
* // Round 10 July 2014 12:12:34 to nearest minute:
|
27 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34))
|
28 |
+
* //=> Thu Jul 10 2014 12:13:00
|
29 |
+
*
|
30 |
+
* @example
|
31 |
+
* // Round 10 July 2014 12:12:34 to nearest quarter hour:
|
32 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 })
|
33 |
+
* //=> Thu Jul 10 2014 12:15:00
|
34 |
+
*
|
35 |
+
* @example
|
36 |
+
* // Floor (rounds down) 10 July 2014 12:12:34 to nearest minute:
|
37 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'floor' })
|
38 |
+
* //=> Thu Jul 10 2014 12:12:00
|
39 |
+
*
|
40 |
+
* @example
|
41 |
+
* // Ceil (rounds up) 10 July 2014 12:12:34 to nearest half hour:
|
42 |
+
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'ceil', nearestTo: 30 })
|
43 |
+
* //=> Thu Jul 10 2014 12:30:00
|
44 |
+
*/
|
45 |
+
export function roundToNearestMinutes(date, options) {
|
46 |
+
const nearestTo = options?.nearestTo ?? 1;
|
47 |
+
|
48 |
+
if (nearestTo < 1 || nearestTo > 30) return constructFrom(date, NaN);
|
49 |
+
|
50 |
+
const _date = toDate(date);
|
51 |
+
const fractionalSeconds = _date.getSeconds() / 60;
|
52 |
+
const fractionalMilliseconds = _date.getMilliseconds() / 1000 / 60;
|
53 |
+
const minutes =
|
54 |
+
_date.getMinutes() + fractionalSeconds + fractionalMilliseconds;
|
55 |
+
|
56 |
+
// Unlike the `differenceIn*` functions, the default rounding behavior is `round` and not 'trunc'
|
57 |
+
const method = options?.roundingMethod ?? "round";
|
58 |
+
const roundingMethod = getRoundingMethod(method);
|
59 |
+
|
60 |
+
const roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo;
|
61 |
+
|
62 |
+
const result = constructFrom(date, _date);
|
63 |
+
result.setMinutes(roundedMinutes, 0, 0);
|
64 |
+
return result;
|
65 |
+
}
|
66 |
+
|
67 |
+
// Fallback for modularized imports:
|
68 |
+
export default roundToNearestMinutes;
|
workers1/auto3d/node_modules/date-fns/secondsToHours.d.mts
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name secondsToHours
|
3 |
+
* @category Conversion Helpers
|
4 |
+
* @summary Convert seconds to hours.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Convert a number of seconds to a full number of hours.
|
8 |
+
*
|
9 |
+
* @param seconds - The number of seconds to be converted
|
10 |
+
*
|
11 |
+
* @returns The number of seconds converted in hours
|
12 |
+
*
|
13 |
+
* @example
|
14 |
+
* // Convert 7200 seconds into hours
|
15 |
+
* const result = secondsToHours(7200)
|
16 |
+
* //=> 2
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // It uses floor rounding:
|
20 |
+
* const result = secondsToHours(7199)
|
21 |
+
* //=> 1
|
22 |
+
*/
|
23 |
+
export declare function secondsToHours(seconds: number): number;
|
workers1/auto3d/node_modules/date-fns/secondsToHours.d.ts
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name secondsToHours
|
3 |
+
* @category Conversion Helpers
|
4 |
+
* @summary Convert seconds to hours.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Convert a number of seconds to a full number of hours.
|
8 |
+
*
|
9 |
+
* @param seconds - The number of seconds to be converted
|
10 |
+
*
|
11 |
+
* @returns The number of seconds converted in hours
|
12 |
+
*
|
13 |
+
* @example
|
14 |
+
* // Convert 7200 seconds into hours
|
15 |
+
* const result = secondsToHours(7200)
|
16 |
+
* //=> 2
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // It uses floor rounding:
|
20 |
+
* const result = secondsToHours(7199)
|
21 |
+
* //=> 1
|
22 |
+
*/
|
23 |
+
export declare function secondsToHours(seconds: number): number;
|
workers1/auto3d/node_modules/date-fns/secondsToHours.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.secondsToHours = secondsToHours;
|
3 |
+
var _index = require("./constants.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name secondsToHours
|
7 |
+
* @category Conversion Helpers
|
8 |
+
* @summary Convert seconds to hours.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Convert a number of seconds to a full number of hours.
|
12 |
+
*
|
13 |
+
* @param seconds - The number of seconds to be converted
|
14 |
+
*
|
15 |
+
* @returns The number of seconds converted in hours
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Convert 7200 seconds into hours
|
19 |
+
* const result = secondsToHours(7200)
|
20 |
+
* //=> 2
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // It uses floor rounding:
|
24 |
+
* const result = secondsToHours(7199)
|
25 |
+
* //=> 1
|
26 |
+
*/
|
27 |
+
function secondsToHours(seconds) {
|
28 |
+
const hours = seconds / _index.secondsInHour;
|
29 |
+
return Math.trunc(hours);
|
30 |
+
}
|
workers1/auto3d/node_modules/date-fns/secondsToHours.mjs
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { secondsInHour } from "./constants.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name secondsToHours
|
5 |
+
* @category Conversion Helpers
|
6 |
+
* @summary Convert seconds to hours.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Convert a number of seconds to a full number of hours.
|
10 |
+
*
|
11 |
+
* @param seconds - The number of seconds to be converted
|
12 |
+
*
|
13 |
+
* @returns The number of seconds converted in hours
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Convert 7200 seconds into hours
|
17 |
+
* const result = secondsToHours(7200)
|
18 |
+
* //=> 2
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // It uses floor rounding:
|
22 |
+
* const result = secondsToHours(7199)
|
23 |
+
* //=> 1
|
24 |
+
*/
|
25 |
+
export function secondsToHours(seconds) {
|
26 |
+
const hours = seconds / secondsInHour;
|
27 |
+
return Math.trunc(hours);
|
28 |
+
}
|
29 |
+
|
30 |
+
// Fallback for modularized imports:
|
31 |
+
export default secondsToHours;
|
workers1/auto3d/node_modules/date-fns/secondsToMilliseconds.d.mts
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name secondsToMilliseconds
|
3 |
+
* @category Conversion Helpers
|
4 |
+
* @summary Convert seconds to milliseconds.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Convert a number of seconds to a full number of milliseconds.
|
8 |
+
*
|
9 |
+
* @param seconds - The number of seconds to be converted
|
10 |
+
*
|
11 |
+
* @returns The number of seconds converted in milliseconds
|
12 |
+
*
|
13 |
+
* @example
|
14 |
+
* // Convert 2 seconds into milliseconds
|
15 |
+
* const result = secondsToMilliseconds(2)
|
16 |
+
* //=> 2000
|
17 |
+
*/
|
18 |
+
export declare function secondsToMilliseconds(seconds: number): number;
|
workers1/auto3d/node_modules/date-fns/secondsToMilliseconds.d.ts
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name secondsToMilliseconds
|
3 |
+
* @category Conversion Helpers
|
4 |
+
* @summary Convert seconds to milliseconds.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Convert a number of seconds to a full number of milliseconds.
|
8 |
+
*
|
9 |
+
* @param seconds - The number of seconds to be converted
|
10 |
+
*
|
11 |
+
* @returns The number of seconds converted in milliseconds
|
12 |
+
*
|
13 |
+
* @example
|
14 |
+
* // Convert 2 seconds into milliseconds
|
15 |
+
* const result = secondsToMilliseconds(2)
|
16 |
+
* //=> 2000
|
17 |
+
*/
|
18 |
+
export declare function secondsToMilliseconds(seconds: number): number;
|
workers1/auto3d/node_modules/date-fns/secondsToMilliseconds.js
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.secondsToMilliseconds = secondsToMilliseconds;
|
3 |
+
var _index = require("./constants.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name secondsToMilliseconds
|
7 |
+
* @category Conversion Helpers
|
8 |
+
* @summary Convert seconds to milliseconds.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Convert a number of seconds to a full number of milliseconds.
|
12 |
+
*
|
13 |
+
* @param seconds - The number of seconds to be converted
|
14 |
+
*
|
15 |
+
* @returns The number of seconds converted in milliseconds
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Convert 2 seconds into milliseconds
|
19 |
+
* const result = secondsToMilliseconds(2)
|
20 |
+
* //=> 2000
|
21 |
+
*/
|
22 |
+
function secondsToMilliseconds(seconds) {
|
23 |
+
return seconds * _index.millisecondsInSecond;
|
24 |
+
}
|
workers1/auto3d/node_modules/date-fns/secondsToMilliseconds.mjs
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { millisecondsInSecond } from "./constants.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name secondsToMilliseconds
|
5 |
+
* @category Conversion Helpers
|
6 |
+
* @summary Convert seconds to milliseconds.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Convert a number of seconds to a full number of milliseconds.
|
10 |
+
*
|
11 |
+
* @param seconds - The number of seconds to be converted
|
12 |
+
*
|
13 |
+
* @returns The number of seconds converted in milliseconds
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Convert 2 seconds into milliseconds
|
17 |
+
* const result = secondsToMilliseconds(2)
|
18 |
+
* //=> 2000
|
19 |
+
*/
|
20 |
+
export function secondsToMilliseconds(seconds) {
|
21 |
+
return seconds * millisecondsInSecond;
|
22 |
+
}
|
23 |
+
|
24 |
+
// Fallback for modularized imports:
|
25 |
+
export default secondsToMilliseconds;
|
workers1/auto3d/node_modules/date-fns/secondsToMinutes.d.mts
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name secondsToMinutes
|
3 |
+
* @category Conversion Helpers
|
4 |
+
* @summary Convert seconds to minutes.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Convert a number of seconds to a full number of minutes.
|
8 |
+
*
|
9 |
+
* @param seconds - The number of seconds to be converted
|
10 |
+
*
|
11 |
+
* @returns The number of seconds converted in minutes
|
12 |
+
*
|
13 |
+
* @example
|
14 |
+
* // Convert 120 seconds into minutes
|
15 |
+
* const result = secondsToMinutes(120)
|
16 |
+
* //=> 2
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // It uses floor rounding:
|
20 |
+
* const result = secondsToMinutes(119)
|
21 |
+
* //=> 1
|
22 |
+
*/
|
23 |
+
export declare function secondsToMinutes(seconds: number): number;
|
workers1/auto3d/node_modules/date-fns/secondsToMinutes.d.ts
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name secondsToMinutes
|
3 |
+
* @category Conversion Helpers
|
4 |
+
* @summary Convert seconds to minutes.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Convert a number of seconds to a full number of minutes.
|
8 |
+
*
|
9 |
+
* @param seconds - The number of seconds to be converted
|
10 |
+
*
|
11 |
+
* @returns The number of seconds converted in minutes
|
12 |
+
*
|
13 |
+
* @example
|
14 |
+
* // Convert 120 seconds into minutes
|
15 |
+
* const result = secondsToMinutes(120)
|
16 |
+
* //=> 2
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // It uses floor rounding:
|
20 |
+
* const result = secondsToMinutes(119)
|
21 |
+
* //=> 1
|
22 |
+
*/
|
23 |
+
export declare function secondsToMinutes(seconds: number): number;
|
workers1/auto3d/node_modules/date-fns/secondsToMinutes.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.secondsToMinutes = secondsToMinutes;
|
3 |
+
var _index = require("./constants.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name secondsToMinutes
|
7 |
+
* @category Conversion Helpers
|
8 |
+
* @summary Convert seconds to minutes.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Convert a number of seconds to a full number of minutes.
|
12 |
+
*
|
13 |
+
* @param seconds - The number of seconds to be converted
|
14 |
+
*
|
15 |
+
* @returns The number of seconds converted in minutes
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Convert 120 seconds into minutes
|
19 |
+
* const result = secondsToMinutes(120)
|
20 |
+
* //=> 2
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // It uses floor rounding:
|
24 |
+
* const result = secondsToMinutes(119)
|
25 |
+
* //=> 1
|
26 |
+
*/
|
27 |
+
function secondsToMinutes(seconds) {
|
28 |
+
const minutes = seconds / _index.secondsInMinute;
|
29 |
+
return Math.trunc(minutes);
|
30 |
+
}
|
workers1/auto3d/node_modules/date-fns/secondsToMinutes.mjs
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { secondsInMinute } from "./constants.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name secondsToMinutes
|
5 |
+
* @category Conversion Helpers
|
6 |
+
* @summary Convert seconds to minutes.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Convert a number of seconds to a full number of minutes.
|
10 |
+
*
|
11 |
+
* @param seconds - The number of seconds to be converted
|
12 |
+
*
|
13 |
+
* @returns The number of seconds converted in minutes
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Convert 120 seconds into minutes
|
17 |
+
* const result = secondsToMinutes(120)
|
18 |
+
* //=> 2
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // It uses floor rounding:
|
22 |
+
* const result = secondsToMinutes(119)
|
23 |
+
* //=> 1
|
24 |
+
*/
|
25 |
+
export function secondsToMinutes(seconds) {
|
26 |
+
const minutes = seconds / secondsInMinute;
|
27 |
+
return Math.trunc(minutes);
|
28 |
+
}
|
29 |
+
|
30 |
+
// Fallback for modularized imports:
|
31 |
+
export default secondsToMinutes;
|
workers1/auto3d/node_modules/date-fns/set.d.mts
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { DateValues } from "./types.js";
|
2 |
+
/**
|
3 |
+
* @name set
|
4 |
+
* @category Common Helpers
|
5 |
+
* @summary Set date values to a given date.
|
6 |
+
*
|
7 |
+
* @description
|
8 |
+
* Set date values to a given date.
|
9 |
+
*
|
10 |
+
* Sets time values to date from object `values`.
|
11 |
+
* A value is not set if it is undefined or null or doesn't exist in `values`.
|
12 |
+
*
|
13 |
+
* Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
|
14 |
+
* to use native `Date#setX` methods. If you use this function, you may not want to include the
|
15 |
+
* other `setX` functions that date-fns provides if you are concerned about the bundle size.
|
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 values - The date values to be set
|
21 |
+
*
|
22 |
+
* @returns The new date with options set
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // Transform 1 September 2014 into 20 October 2015 in a single line:
|
26 |
+
* const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
|
27 |
+
* //=> Tue Oct 20 2015 00:00:00
|
28 |
+
*
|
29 |
+
* @example
|
30 |
+
* // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
|
31 |
+
* const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
|
32 |
+
* //=> Mon Sep 01 2014 12:23:45
|
33 |
+
*/
|
34 |
+
export declare function set<DateType extends Date>(
|
35 |
+
date: DateType | number | string,
|
36 |
+
values: DateValues,
|
37 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/set.d.ts
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { DateValues } from "./types.js";
|
2 |
+
/**
|
3 |
+
* @name set
|
4 |
+
* @category Common Helpers
|
5 |
+
* @summary Set date values to a given date.
|
6 |
+
*
|
7 |
+
* @description
|
8 |
+
* Set date values to a given date.
|
9 |
+
*
|
10 |
+
* Sets time values to date from object `values`.
|
11 |
+
* A value is not set if it is undefined or null or doesn't exist in `values`.
|
12 |
+
*
|
13 |
+
* Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
|
14 |
+
* to use native `Date#setX` methods. If you use this function, you may not want to include the
|
15 |
+
* other `setX` functions that date-fns provides if you are concerned about the bundle size.
|
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 values - The date values to be set
|
21 |
+
*
|
22 |
+
* @returns The new date with options set
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // Transform 1 September 2014 into 20 October 2015 in a single line:
|
26 |
+
* const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
|
27 |
+
* //=> Tue Oct 20 2015 00:00:00
|
28 |
+
*
|
29 |
+
* @example
|
30 |
+
* // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
|
31 |
+
* const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
|
32 |
+
* //=> Mon Sep 01 2014 12:23:45
|
33 |
+
*/
|
34 |
+
export declare function set<DateType extends Date>(
|
35 |
+
date: DateType | number | string,
|
36 |
+
values: DateValues,
|
37 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/set.js
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.set = set;
|
3 |
+
var _index = require("./constructFrom.js");
|
4 |
+
var _index2 = require("./setMonth.js");
|
5 |
+
var _index3 = require("./toDate.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @name set
|
9 |
+
* @category Common Helpers
|
10 |
+
* @summary Set date values to a given date.
|
11 |
+
*
|
12 |
+
* @description
|
13 |
+
* Set date values to a given date.
|
14 |
+
*
|
15 |
+
* Sets time values to date from object `values`.
|
16 |
+
* A value is not set if it is undefined or null or doesn't exist in `values`.
|
17 |
+
*
|
18 |
+
* Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
|
19 |
+
* to use native `Date#setX` methods. If you use this function, you may not want to include the
|
20 |
+
* other `setX` functions that date-fns provides if you are concerned about the bundle size.
|
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 values - The date values to be set
|
26 |
+
*
|
27 |
+
* @returns The new date with options set
|
28 |
+
*
|
29 |
+
* @example
|
30 |
+
* // Transform 1 September 2014 into 20 October 2015 in a single line:
|
31 |
+
* const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
|
32 |
+
* //=> Tue Oct 20 2015 00:00:00
|
33 |
+
*
|
34 |
+
* @example
|
35 |
+
* // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
|
36 |
+
* const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
|
37 |
+
* //=> Mon Sep 01 2014 12:23:45
|
38 |
+
*/
|
39 |
+
|
40 |
+
function set(date, values) {
|
41 |
+
let _date = (0, _index3.toDate)(date);
|
42 |
+
|
43 |
+
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
|
44 |
+
if (isNaN(+_date)) {
|
45 |
+
return (0, _index.constructFrom)(date, NaN);
|
46 |
+
}
|
47 |
+
|
48 |
+
if (values.year != null) {
|
49 |
+
_date.setFullYear(values.year);
|
50 |
+
}
|
51 |
+
|
52 |
+
if (values.month != null) {
|
53 |
+
_date = (0, _index2.setMonth)(_date, values.month);
|
54 |
+
}
|
55 |
+
|
56 |
+
if (values.date != null) {
|
57 |
+
_date.setDate(values.date);
|
58 |
+
}
|
59 |
+
|
60 |
+
if (values.hours != null) {
|
61 |
+
_date.setHours(values.hours);
|
62 |
+
}
|
63 |
+
|
64 |
+
if (values.minutes != null) {
|
65 |
+
_date.setMinutes(values.minutes);
|
66 |
+
}
|
67 |
+
|
68 |
+
if (values.seconds != null) {
|
69 |
+
_date.setSeconds(values.seconds);
|
70 |
+
}
|
71 |
+
|
72 |
+
if (values.milliseconds != null) {
|
73 |
+
_date.setMilliseconds(values.milliseconds);
|
74 |
+
}
|
75 |
+
|
76 |
+
return _date;
|
77 |
+
}
|
workers1/auto3d/node_modules/date-fns/set.mjs
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { constructFrom } from "./constructFrom.mjs";
|
2 |
+
import { setMonth } from "./setMonth.mjs";
|
3 |
+
import { toDate } from "./toDate.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name set
|
7 |
+
* @category Common Helpers
|
8 |
+
* @summary Set date values to a given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Set date values to a given date.
|
12 |
+
*
|
13 |
+
* Sets time values to date from object `values`.
|
14 |
+
* A value is not set if it is undefined or null or doesn't exist in `values`.
|
15 |
+
*
|
16 |
+
* Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
|
17 |
+
* to use native `Date#setX` methods. If you use this function, you may not want to include the
|
18 |
+
* other `setX` functions that date-fns provides if you are concerned about the bundle size.
|
19 |
+
*
|
20 |
+
* @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).
|
21 |
+
*
|
22 |
+
* @param date - The date to be changed
|
23 |
+
* @param values - The date values to be set
|
24 |
+
*
|
25 |
+
* @returns The new date with options set
|
26 |
+
*
|
27 |
+
* @example
|
28 |
+
* // Transform 1 September 2014 into 20 October 2015 in a single line:
|
29 |
+
* const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
|
30 |
+
* //=> Tue Oct 20 2015 00:00:00
|
31 |
+
*
|
32 |
+
* @example
|
33 |
+
* // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
|
34 |
+
* const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
|
35 |
+
* //=> Mon Sep 01 2014 12:23:45
|
36 |
+
*/
|
37 |
+
|
38 |
+
export function set(date, values) {
|
39 |
+
let _date = toDate(date);
|
40 |
+
|
41 |
+
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
|
42 |
+
if (isNaN(+_date)) {
|
43 |
+
return constructFrom(date, NaN);
|
44 |
+
}
|
45 |
+
|
46 |
+
if (values.year != null) {
|
47 |
+
_date.setFullYear(values.year);
|
48 |
+
}
|
49 |
+
|
50 |
+
if (values.month != null) {
|
51 |
+
_date = setMonth(_date, values.month);
|
52 |
+
}
|
53 |
+
|
54 |
+
if (values.date != null) {
|
55 |
+
_date.setDate(values.date);
|
56 |
+
}
|
57 |
+
|
58 |
+
if (values.hours != null) {
|
59 |
+
_date.setHours(values.hours);
|
60 |
+
}
|
61 |
+
|
62 |
+
if (values.minutes != null) {
|
63 |
+
_date.setMinutes(values.minutes);
|
64 |
+
}
|
65 |
+
|
66 |
+
if (values.seconds != null) {
|
67 |
+
_date.setSeconds(values.seconds);
|
68 |
+
}
|
69 |
+
|
70 |
+
if (values.milliseconds != null) {
|
71 |
+
_date.setMilliseconds(values.milliseconds);
|
72 |
+
}
|
73 |
+
|
74 |
+
return _date;
|
75 |
+
}
|
76 |
+
|
77 |
+
// Fallback for modularized imports:
|
78 |
+
export default set;
|
workers1/auto3d/node_modules/date-fns/setDate.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setDate
|
3 |
+
* @category Day Helpers
|
4 |
+
* @summary Set the day of the month to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the day of 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 dayOfMonth - The day of the month of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the day of the month set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set the 30th day of the month to 1 September 2014:
|
18 |
+
* const result = setDate(new Date(2014, 8, 1), 30)
|
19 |
+
* //=> Tue Sep 30 2014 00:00:00
|
20 |
+
*/
|
21 |
+
export declare function setDate<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
dayOfMonth: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setDate.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setDate
|
3 |
+
* @category Day Helpers
|
4 |
+
* @summary Set the day of the month to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the day of 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 dayOfMonth - The day of the month of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the day of the month set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set the 30th day of the month to 1 September 2014:
|
18 |
+
* const result = setDate(new Date(2014, 8, 1), 30)
|
19 |
+
* //=> Tue Sep 30 2014 00:00:00
|
20 |
+
*/
|
21 |
+
export declare function setDate<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
dayOfMonth: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setDate.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setDate = setDate;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name setDate
|
7 |
+
* @category Day Helpers
|
8 |
+
* @summary Set the day of the month to the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Set the day of 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 dayOfMonth - The day of the month of the new date
|
17 |
+
*
|
18 |
+
* @returns The new date with the day of the month set
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // Set the 30th day of the month to 1 September 2014:
|
22 |
+
* const result = setDate(new Date(2014, 8, 1), 30)
|
23 |
+
* //=> Tue Sep 30 2014 00:00:00
|
24 |
+
*/
|
25 |
+
function setDate(date, dayOfMonth) {
|
26 |
+
const _date = (0, _index.toDate)(date);
|
27 |
+
_date.setDate(dayOfMonth);
|
28 |
+
return _date;
|
29 |
+
}
|
workers1/auto3d/node_modules/date-fns/setDate.mjs
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name setDate
|
5 |
+
* @category Day Helpers
|
6 |
+
* @summary Set the day of the month to the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Set the day of the month 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 dayOfMonth - The day of the month of the new date
|
15 |
+
*
|
16 |
+
* @returns The new date with the day of the month set
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Set the 30th day of the month to 1 September 2014:
|
20 |
+
* const result = setDate(new Date(2014, 8, 1), 30)
|
21 |
+
* //=> Tue Sep 30 2014 00:00:00
|
22 |
+
*/
|
23 |
+
export function setDate(date, dayOfMonth) {
|
24 |
+
const _date = toDate(date);
|
25 |
+
_date.setDate(dayOfMonth);
|
26 |
+
return _date;
|
27 |
+
}
|
28 |
+
|
29 |
+
// Fallback for modularized imports:
|
30 |
+
export default setDate;
|
workers1/auto3d/node_modules/date-fns/setDay.d.mts
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { LocalizedOptions, WeekOptions } from "./types.js";
|
2 |
+
/**
|
3 |
+
* The {@link setDay} function options.
|
4 |
+
*/
|
5 |
+
export interface SetDayOptions
|
6 |
+
extends LocalizedOptions<"options">,
|
7 |
+
WeekOptions {}
|
8 |
+
/**
|
9 |
+
* @name setDay
|
10 |
+
* @category Weekday Helpers
|
11 |
+
* @summary Set the day of the week to the given date.
|
12 |
+
*
|
13 |
+
* @description
|
14 |
+
* Set the day of the week to the given 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 day - The day of the week of the new date
|
20 |
+
* @param options - An object with options.
|
21 |
+
*
|
22 |
+
* @returns The new date with the day of the week set
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // Set week day to Sunday, with the default weekStartsOn of Sunday:
|
26 |
+
* const result = setDay(new Date(2014, 8, 1), 0)
|
27 |
+
* //=> Sun Aug 31 2014 00:00:00
|
28 |
+
*
|
29 |
+
* @example
|
30 |
+
* // Set week day to Sunday, with a weekStartsOn of Monday:
|
31 |
+
* const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })
|
32 |
+
* //=> Sun Sep 07 2014 00:00:00
|
33 |
+
*/
|
34 |
+
export declare function setDay<DateType extends Date>(
|
35 |
+
date: DateType | number | string,
|
36 |
+
day: number,
|
37 |
+
options?: SetDayOptions,
|
38 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setDay.d.ts
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { LocalizedOptions, WeekOptions } from "./types.js";
|
2 |
+
/**
|
3 |
+
* The {@link setDay} function options.
|
4 |
+
*/
|
5 |
+
export interface SetDayOptions
|
6 |
+
extends LocalizedOptions<"options">,
|
7 |
+
WeekOptions {}
|
8 |
+
/**
|
9 |
+
* @name setDay
|
10 |
+
* @category Weekday Helpers
|
11 |
+
* @summary Set the day of the week to the given date.
|
12 |
+
*
|
13 |
+
* @description
|
14 |
+
* Set the day of the week to the given 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 day - The day of the week of the new date
|
20 |
+
* @param options - An object with options.
|
21 |
+
*
|
22 |
+
* @returns The new date with the day of the week set
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // Set week day to Sunday, with the default weekStartsOn of Sunday:
|
26 |
+
* const result = setDay(new Date(2014, 8, 1), 0)
|
27 |
+
* //=> Sun Aug 31 2014 00:00:00
|
28 |
+
*
|
29 |
+
* @example
|
30 |
+
* // Set week day to Sunday, with a weekStartsOn of Monday:
|
31 |
+
* const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })
|
32 |
+
* //=> Sun Sep 07 2014 00:00:00
|
33 |
+
*/
|
34 |
+
export declare function setDay<DateType extends Date>(
|
35 |
+
date: DateType | number | string,
|
36 |
+
day: number,
|
37 |
+
options?: SetDayOptions,
|
38 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setDay.js
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setDay = setDay;
|
3 |
+
var _index = require("./addDays.js");
|
4 |
+
var _index2 = require("./toDate.js");
|
5 |
+
|
6 |
+
var _index3 = require("./_lib/defaultOptions.js");
|
7 |
+
|
8 |
+
/**
|
9 |
+
* The {@link setDay} function options.
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @name setDay
|
14 |
+
* @category Weekday Helpers
|
15 |
+
* @summary Set the day of the week to the given date.
|
16 |
+
*
|
17 |
+
* @description
|
18 |
+
* Set the day of the week to the given date.
|
19 |
+
*
|
20 |
+
* @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).
|
21 |
+
*
|
22 |
+
* @param date - The date to be changed
|
23 |
+
* @param day - The day of the week of the new date
|
24 |
+
* @param options - An object with options.
|
25 |
+
*
|
26 |
+
* @returns The new date with the day of the week set
|
27 |
+
*
|
28 |
+
* @example
|
29 |
+
* // Set week day to Sunday, with the default weekStartsOn of Sunday:
|
30 |
+
* const result = setDay(new Date(2014, 8, 1), 0)
|
31 |
+
* //=> Sun Aug 31 2014 00:00:00
|
32 |
+
*
|
33 |
+
* @example
|
34 |
+
* // Set week day to Sunday, with a weekStartsOn of Monday:
|
35 |
+
* const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })
|
36 |
+
* //=> Sun Sep 07 2014 00:00:00
|
37 |
+
*/
|
38 |
+
function setDay(date, day, options) {
|
39 |
+
const defaultOptions = (0, _index3.getDefaultOptions)();
|
40 |
+
const weekStartsOn =
|
41 |
+
options?.weekStartsOn ??
|
42 |
+
options?.locale?.options?.weekStartsOn ??
|
43 |
+
defaultOptions.weekStartsOn ??
|
44 |
+
defaultOptions.locale?.options?.weekStartsOn ??
|
45 |
+
0;
|
46 |
+
|
47 |
+
const _date = (0, _index2.toDate)(date);
|
48 |
+
const currentDay = _date.getDay();
|
49 |
+
|
50 |
+
const remainder = day % 7;
|
51 |
+
const dayIndex = (remainder + 7) % 7;
|
52 |
+
|
53 |
+
const delta = 7 - weekStartsOn;
|
54 |
+
const diff =
|
55 |
+
day < 0 || day > 6
|
56 |
+
? day - ((currentDay + delta) % 7)
|
57 |
+
: ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);
|
58 |
+
return (0, _index.addDays)(_date, diff);
|
59 |
+
}
|
workers1/auto3d/node_modules/date-fns/setDay.mjs
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { addDays } from "./addDays.mjs";
|
2 |
+
import { toDate } from "./toDate.mjs";
|
3 |
+
import { getDefaultOptions } from "./_lib/defaultOptions.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* The {@link setDay} function options.
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @name setDay
|
11 |
+
* @category Weekday Helpers
|
12 |
+
* @summary Set the day of the week to the given date.
|
13 |
+
*
|
14 |
+
* @description
|
15 |
+
* Set the day of the week to the given 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 day - The day of the week of the new date
|
21 |
+
* @param options - An object with options.
|
22 |
+
*
|
23 |
+
* @returns The new date with the day of the week set
|
24 |
+
*
|
25 |
+
* @example
|
26 |
+
* // Set week day to Sunday, with the default weekStartsOn of Sunday:
|
27 |
+
* const result = setDay(new Date(2014, 8, 1), 0)
|
28 |
+
* //=> Sun Aug 31 2014 00:00:00
|
29 |
+
*
|
30 |
+
* @example
|
31 |
+
* // Set week day to Sunday, with a weekStartsOn of Monday:
|
32 |
+
* const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })
|
33 |
+
* //=> Sun Sep 07 2014 00:00:00
|
34 |
+
*/
|
35 |
+
export function setDay(date, day, options) {
|
36 |
+
const defaultOptions = getDefaultOptions();
|
37 |
+
const weekStartsOn =
|
38 |
+
options?.weekStartsOn ??
|
39 |
+
options?.locale?.options?.weekStartsOn ??
|
40 |
+
defaultOptions.weekStartsOn ??
|
41 |
+
defaultOptions.locale?.options?.weekStartsOn ??
|
42 |
+
0;
|
43 |
+
|
44 |
+
const _date = toDate(date);
|
45 |
+
const currentDay = _date.getDay();
|
46 |
+
|
47 |
+
const remainder = day % 7;
|
48 |
+
const dayIndex = (remainder + 7) % 7;
|
49 |
+
|
50 |
+
const delta = 7 - weekStartsOn;
|
51 |
+
const diff =
|
52 |
+
day < 0 || day > 6
|
53 |
+
? day - ((currentDay + delta) % 7)
|
54 |
+
: ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);
|
55 |
+
return addDays(_date, diff);
|
56 |
+
}
|
57 |
+
|
58 |
+
// Fallback for modularized imports:
|
59 |
+
export default setDay;
|
workers1/auto3d/node_modules/date-fns/setDayOfYear.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setDayOfYear
|
3 |
+
* @category Day Helpers
|
4 |
+
* @summary Set the day of the year to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the day of 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 dayOfYear - The day of the year of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the day of the year set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set the 2nd day of the year to 2 July 2014:
|
18 |
+
* const result = setDayOfYear(new Date(2014, 6, 2), 2)
|
19 |
+
* //=> Thu Jan 02 2014 00:00:00
|
20 |
+
*/
|
21 |
+
export declare function setDayOfYear<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
dayOfYear: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setDayOfYear.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name setDayOfYear
|
3 |
+
* @category Day Helpers
|
4 |
+
* @summary Set the day of the year to the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Set the day of 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 dayOfYear - The day of the year of the new date
|
13 |
+
*
|
14 |
+
* @returns The new date with the day of the year set
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // Set the 2nd day of the year to 2 July 2014:
|
18 |
+
* const result = setDayOfYear(new Date(2014, 6, 2), 2)
|
19 |
+
* //=> Thu Jan 02 2014 00:00:00
|
20 |
+
*/
|
21 |
+
export declare function setDayOfYear<DateType extends Date>(
|
22 |
+
date: DateType | number | string,
|
23 |
+
dayOfYear: number,
|
24 |
+
): DateType;
|
workers1/auto3d/node_modules/date-fns/setDayOfYear.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.setDayOfYear = setDayOfYear;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name setDayOfYear
|
7 |
+
* @category Day Helpers
|
8 |
+
* @summary Set the day of the year to the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Set the day of the year 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 dayOfYear - The day of the year of the new date
|
17 |
+
*
|
18 |
+
* @returns The new date with the day of the year set
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // Set the 2nd day of the year to 2 July 2014:
|
22 |
+
* const result = setDayOfYear(new Date(2014, 6, 2), 2)
|
23 |
+
* //=> Thu Jan 02 2014 00:00:00
|
24 |
+
*/
|
25 |
+
function setDayOfYear(date, dayOfYear) {
|
26 |
+
const _date = (0, _index.toDate)(date);
|
27 |
+
_date.setMonth(0);
|
28 |
+
_date.setDate(dayOfYear);
|
29 |
+
return _date;
|
30 |
+
}
|
workers1/auto3d/node_modules/date-fns/setDayOfYear.mjs
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name setDayOfYear
|
5 |
+
* @category Day Helpers
|
6 |
+
* @summary Set the day of the year to the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Set the day of the year 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 dayOfYear - The day of the year of the new date
|
15 |
+
*
|
16 |
+
* @returns The new date with the day of the year set
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Set the 2nd day of the year to 2 July 2014:
|
20 |
+
* const result = setDayOfYear(new Date(2014, 6, 2), 2)
|
21 |
+
* //=> Thu Jan 02 2014 00:00:00
|
22 |
+
*/
|
23 |
+
export function setDayOfYear(date, dayOfYear) {
|
24 |
+
const _date = toDate(date);
|
25 |
+
_date.setMonth(0);
|
26 |
+
_date.setDate(dayOfYear);
|
27 |
+
return _date;
|
28 |
+
}
|
29 |
+
|
30 |
+
// Fallback for modularized imports:
|
31 |
+
export default setDayOfYear;
|
workers1/auto3d/node_modules/date-fns/setDefaultOptions.d.mts
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { DefaultOptions } from "./_lib/defaultOptions.js";
|
2 |
+
/**
|
3 |
+
* @name setDefaultOptions
|
4 |
+
* @category Common Helpers
|
5 |
+
* @summary Set default options including locale.
|
6 |
+
* @pure false
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Sets the defaults for
|
10 |
+
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
|
11 |
+
* arguments for all functions.
|
12 |
+
*
|
13 |
+
* @param options - An object with options
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Set global locale:
|
17 |
+
* import { es } from 'date-fns/locale'
|
18 |
+
* setDefaultOptions({ locale: es })
|
19 |
+
* const result = format(new Date(2014, 8, 2), 'PPPP')
|
20 |
+
* //=> 'martes, 2 de septiembre de 2014'
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // Start of the week for 2 September 2014:
|
24 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
25 |
+
* //=> Sun Aug 31 2014 00:00:00
|
26 |
+
*
|
27 |
+
* @example
|
28 |
+
* // Start of the week for 2 September 2014,
|
29 |
+
* // when we set that week starts on Monday by default:
|
30 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
31 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
32 |
+
* //=> Mon Sep 01 2014 00:00:00
|
33 |
+
*
|
34 |
+
* @example
|
35 |
+
* // Manually set options take priority over default options:
|
36 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
37 |
+
* const result = startOfWeek(new Date(2014, 8, 2), { weekStartsOn: 0 })
|
38 |
+
* //=> Sun Aug 31 2014 00:00:00
|
39 |
+
*
|
40 |
+
* @example
|
41 |
+
* // Remove the option by setting it to `undefined`:
|
42 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
43 |
+
* setDefaultOptions({ weekStartsOn: undefined })
|
44 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
45 |
+
* //=> Sun Aug 31 2014 00:00:00
|
46 |
+
*/
|
47 |
+
export declare function setDefaultOptions(options: DefaultOptions): void;
|
workers1/auto3d/node_modules/date-fns/setDefaultOptions.d.ts
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { DefaultOptions } from "./_lib/defaultOptions.js";
|
2 |
+
/**
|
3 |
+
* @name setDefaultOptions
|
4 |
+
* @category Common Helpers
|
5 |
+
* @summary Set default options including locale.
|
6 |
+
* @pure false
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Sets the defaults for
|
10 |
+
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
|
11 |
+
* arguments for all functions.
|
12 |
+
*
|
13 |
+
* @param options - An object with options
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Set global locale:
|
17 |
+
* import { es } from 'date-fns/locale'
|
18 |
+
* setDefaultOptions({ locale: es })
|
19 |
+
* const result = format(new Date(2014, 8, 2), 'PPPP')
|
20 |
+
* //=> 'martes, 2 de septiembre de 2014'
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // Start of the week for 2 September 2014:
|
24 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
25 |
+
* //=> Sun Aug 31 2014 00:00:00
|
26 |
+
*
|
27 |
+
* @example
|
28 |
+
* // Start of the week for 2 September 2014,
|
29 |
+
* // when we set that week starts on Monday by default:
|
30 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
31 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
32 |
+
* //=> Mon Sep 01 2014 00:00:00
|
33 |
+
*
|
34 |
+
* @example
|
35 |
+
* // Manually set options take priority over default options:
|
36 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
37 |
+
* const result = startOfWeek(new Date(2014, 8, 2), { weekStartsOn: 0 })
|
38 |
+
* //=> Sun Aug 31 2014 00:00:00
|
39 |
+
*
|
40 |
+
* @example
|
41 |
+
* // Remove the option by setting it to `undefined`:
|
42 |
+
* setDefaultOptions({ weekStartsOn: 1 })
|
43 |
+
* setDefaultOptions({ weekStartsOn: undefined })
|
44 |
+
* const result = startOfWeek(new Date(2014, 8, 2))
|
45 |
+
* //=> Sun Aug 31 2014 00:00:00
|
46 |
+
*/
|
47 |
+
export declare function setDefaultOptions(options: DefaultOptions): void;
|