Spaces:
Configuration error
Configuration error
luigi12345
commited on
Commit
•
884c58d
1
Parent(s):
b454e02
1527d10e2d21c543c437df729f875d8ce329df86765c6b2f3b30d5de333202b2
Browse files- workers1/auto3d/node_modules/date-fns/getDaysInMonth.d.ts +22 -0
- workers1/auto3d/node_modules/date-fns/getDaysInMonth.js +33 -0
- workers1/auto3d/node_modules/date-fns/getDaysInMonth.mjs +34 -0
- workers1/auto3d/node_modules/date-fns/getDaysInYear.d.mts +22 -0
- workers1/auto3d/node_modules/date-fns/getDaysInYear.d.ts +22 -0
- workers1/auto3d/node_modules/date-fns/getDaysInYear.js +33 -0
- workers1/auto3d/node_modules/date-fns/getDaysInYear.mjs +34 -0
- workers1/auto3d/node_modules/date-fns/getDecade.d.mts +22 -0
- workers1/auto3d/node_modules/date-fns/getDecade.d.ts +22 -0
- workers1/auto3d/node_modules/date-fns/getDecade.js +32 -0
- workers1/auto3d/node_modules/date-fns/getDecade.mjs +33 -0
- workers1/auto3d/node_modules/date-fns/getDefaultOptions.d.mts +26 -0
- workers1/auto3d/node_modules/date-fns/getDefaultOptions.d.ts +26 -0
- workers1/auto3d/node_modules/date-fns/getDefaultOptions.js +32 -0
- workers1/auto3d/node_modules/date-fns/getDefaultOptions.mjs +32 -0
- workers1/auto3d/node_modules/date-fns/getHours.d.mts +22 -0
- workers1/auto3d/node_modules/date-fns/getHours.d.ts +22 -0
- workers1/auto3d/node_modules/date-fns/getHours.js +28 -0
- workers1/auto3d/node_modules/date-fns/getHours.mjs +29 -0
- workers1/auto3d/node_modules/date-fns/getISODay.d.mts +25 -0
- workers1/auto3d/node_modules/date-fns/getISODay.d.ts +25 -0
- workers1/auto3d/node_modules/date-fns/getISODay.js +36 -0
- workers1/auto3d/node_modules/date-fns/getISODay.mjs +37 -0
- workers1/auto3d/node_modules/date-fns/getISOWeek.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/getISOWeek.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/getISOWeek.js +39 -0
- workers1/auto3d/node_modules/date-fns/getISOWeek.mjs +38 -0
- workers1/auto3d/node_modules/date-fns/getISOWeekYear.d.mts +25 -0
- workers1/auto3d/node_modules/date-fns/getISOWeekYear.d.ts +25 -0
- workers1/auto3d/node_modules/date-fns/getISOWeekYear.js +54 -0
- workers1/auto3d/node_modules/date-fns/getISOWeekYear.mjs +51 -0
- workers1/auto3d/node_modules/date-fns/getISOWeeksInYear.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/getISOWeeksInYear.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/getISOWeeksInYear.js +39 -0
- workers1/auto3d/node_modules/date-fns/getISOWeeksInYear.mjs +38 -0
- workers1/auto3d/node_modules/date-fns/getMilliseconds.d.mts +22 -0
- workers1/auto3d/node_modules/date-fns/getMilliseconds.d.ts +22 -0
- workers1/auto3d/node_modules/date-fns/getMilliseconds.js +28 -0
- workers1/auto3d/node_modules/date-fns/getMilliseconds.mjs +29 -0
- workers1/auto3d/node_modules/date-fns/getMinutes.d.mts +22 -0
- workers1/auto3d/node_modules/date-fns/getMinutes.d.ts +22 -0
- workers1/auto3d/node_modules/date-fns/getMinutes.js +28 -0
- workers1/auto3d/node_modules/date-fns/getMinutes.mjs +29 -0
- workers1/auto3d/node_modules/date-fns/getMonth.d.mts +22 -0
- workers1/auto3d/node_modules/date-fns/getMonth.d.ts +22 -0
- workers1/auto3d/node_modules/date-fns/getMonth.js +28 -0
- workers1/auto3d/node_modules/date-fns/getMonth.mjs +29 -0
- workers1/auto3d/node_modules/date-fns/getOverlappingDaysInIntervals.d.mts +41 -0
- workers1/auto3d/node_modules/date-fns/getOverlappingDaysInIntervals.d.ts +41 -0
- workers1/auto3d/node_modules/date-fns/getOverlappingDaysInIntervals.js +68 -0
workers1/auto3d/node_modules/date-fns/getDaysInMonth.d.ts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getDaysInMonth
|
3 |
+
* @category Month Helpers
|
4 |
+
* @summary Get the number of days in a month of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of days in a month of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The number of days in a month
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // How many days are in February 2000?
|
17 |
+
* const result = getDaysInMonth(new Date(2000, 1))
|
18 |
+
* //=> 29
|
19 |
+
*/
|
20 |
+
export declare function getDaysInMonth<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getDaysInMonth.js
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getDaysInMonth = getDaysInMonth;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
var _index2 = require("./constructFrom.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name getDaysInMonth
|
8 |
+
* @category Month Helpers
|
9 |
+
* @summary Get the number of days in a month of the given date.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the number of days in a month of 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 given date
|
17 |
+
*
|
18 |
+
* @returns The number of days in a month
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // How many days are in February 2000?
|
22 |
+
* const result = getDaysInMonth(new Date(2000, 1))
|
23 |
+
* //=> 29
|
24 |
+
*/
|
25 |
+
function getDaysInMonth(date) {
|
26 |
+
const _date = (0, _index.toDate)(date);
|
27 |
+
const year = _date.getFullYear();
|
28 |
+
const monthIndex = _date.getMonth();
|
29 |
+
const lastDayOfMonth = (0, _index2.constructFrom)(date, 0);
|
30 |
+
lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
|
31 |
+
lastDayOfMonth.setHours(0, 0, 0, 0);
|
32 |
+
return lastDayOfMonth.getDate();
|
33 |
+
}
|
workers1/auto3d/node_modules/date-fns/getDaysInMonth.mjs
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
import { constructFrom } from "./constructFrom.mjs";
|
3 |
+
|
4 |
+
/**
|
5 |
+
* @name getDaysInMonth
|
6 |
+
* @category Month Helpers
|
7 |
+
* @summary Get the number of days in a month of the given date.
|
8 |
+
*
|
9 |
+
* @description
|
10 |
+
* Get the number of days in a month of 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 given date
|
15 |
+
*
|
16 |
+
* @returns The number of days in a month
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // How many days are in February 2000?
|
20 |
+
* const result = getDaysInMonth(new Date(2000, 1))
|
21 |
+
* //=> 29
|
22 |
+
*/
|
23 |
+
export function getDaysInMonth(date) {
|
24 |
+
const _date = toDate(date);
|
25 |
+
const year = _date.getFullYear();
|
26 |
+
const monthIndex = _date.getMonth();
|
27 |
+
const lastDayOfMonth = constructFrom(date, 0);
|
28 |
+
lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
|
29 |
+
lastDayOfMonth.setHours(0, 0, 0, 0);
|
30 |
+
return lastDayOfMonth.getDate();
|
31 |
+
}
|
32 |
+
|
33 |
+
// Fallback for modularized imports:
|
34 |
+
export default getDaysInMonth;
|
workers1/auto3d/node_modules/date-fns/getDaysInYear.d.mts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getDaysInYear
|
3 |
+
* @category Year Helpers
|
4 |
+
* @summary Get the number of days in a year of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of days in a year of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The number of days in a year
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // How many days are in 2012?
|
17 |
+
* const result = getDaysInYear(new Date(2012, 0, 1))
|
18 |
+
* //=> 366
|
19 |
+
*/
|
20 |
+
export declare function getDaysInYear<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getDaysInYear.d.ts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getDaysInYear
|
3 |
+
* @category Year Helpers
|
4 |
+
* @summary Get the number of days in a year of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of days in a year of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The number of days in a year
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // How many days are in 2012?
|
17 |
+
* const result = getDaysInYear(new Date(2012, 0, 1))
|
18 |
+
* //=> 366
|
19 |
+
*/
|
20 |
+
export declare function getDaysInYear<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getDaysInYear.js
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getDaysInYear = getDaysInYear;
|
3 |
+
var _index = require("./isLeapYear.js");
|
4 |
+
var _index2 = require("./toDate.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name getDaysInYear
|
8 |
+
* @category Year Helpers
|
9 |
+
* @summary Get the number of days in a year of the given date.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the number of days in a year of 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 given date
|
17 |
+
*
|
18 |
+
* @returns The number of days in a year
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // How many days are in 2012?
|
22 |
+
* const result = getDaysInYear(new Date(2012, 0, 1))
|
23 |
+
* //=> 366
|
24 |
+
*/
|
25 |
+
function getDaysInYear(date) {
|
26 |
+
const _date = (0, _index2.toDate)(date);
|
27 |
+
|
28 |
+
if (String(new Date(_date)) === "Invalid Date") {
|
29 |
+
return NaN;
|
30 |
+
}
|
31 |
+
|
32 |
+
return (0, _index.isLeapYear)(_date) ? 366 : 365;
|
33 |
+
}
|
workers1/auto3d/node_modules/date-fns/getDaysInYear.mjs
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { isLeapYear } from "./isLeapYear.mjs";
|
2 |
+
import { toDate } from "./toDate.mjs";
|
3 |
+
|
4 |
+
/**
|
5 |
+
* @name getDaysInYear
|
6 |
+
* @category Year Helpers
|
7 |
+
* @summary Get the number of days in a year of the given date.
|
8 |
+
*
|
9 |
+
* @description
|
10 |
+
* Get the number of days in a year of 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 given date
|
15 |
+
*
|
16 |
+
* @returns The number of days in a year
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // How many days are in 2012?
|
20 |
+
* const result = getDaysInYear(new Date(2012, 0, 1))
|
21 |
+
* //=> 366
|
22 |
+
*/
|
23 |
+
export function getDaysInYear(date) {
|
24 |
+
const _date = toDate(date);
|
25 |
+
|
26 |
+
if (String(new Date(_date)) === "Invalid Date") {
|
27 |
+
return NaN;
|
28 |
+
}
|
29 |
+
|
30 |
+
return isLeapYear(_date) ? 366 : 365;
|
31 |
+
}
|
32 |
+
|
33 |
+
// Fallback for modularized imports:
|
34 |
+
export default getDaysInYear;
|
workers1/auto3d/node_modules/date-fns/getDecade.d.mts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getDecade
|
3 |
+
* @category Decade Helpers
|
4 |
+
* @summary Get the decade of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the decade of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The year of decade
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Which decade belongs 27 November 1942?
|
17 |
+
* const result = getDecade(new Date(1942, 10, 27))
|
18 |
+
* //=> 1940
|
19 |
+
*/
|
20 |
+
export declare function getDecade<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getDecade.d.ts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getDecade
|
3 |
+
* @category Decade Helpers
|
4 |
+
* @summary Get the decade of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the decade of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The year of decade
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Which decade belongs 27 November 1942?
|
17 |
+
* const result = getDecade(new Date(1942, 10, 27))
|
18 |
+
* //=> 1940
|
19 |
+
*/
|
20 |
+
export declare function getDecade<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getDecade.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getDecade = getDecade;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name getDecade
|
7 |
+
* @category Decade Helpers
|
8 |
+
* @summary Get the decade of the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the decade of 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 given date
|
16 |
+
*
|
17 |
+
* @returns The year of decade
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Which decade belongs 27 November 1942?
|
21 |
+
* const result = getDecade(new Date(1942, 10, 27))
|
22 |
+
* //=> 1940
|
23 |
+
*/
|
24 |
+
function getDecade(date) {
|
25 |
+
// TODO: Switch to more technical definition in of decades that start with 1
|
26 |
+
// end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking
|
27 |
+
// change, so it can only be done in 4.0.
|
28 |
+
const _date = (0, _index.toDate)(date);
|
29 |
+
const year = _date.getFullYear();
|
30 |
+
const decade = Math.floor(year / 10) * 10;
|
31 |
+
return decade;
|
32 |
+
}
|
workers1/auto3d/node_modules/date-fns/getDecade.mjs
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name getDecade
|
5 |
+
* @category Decade Helpers
|
6 |
+
* @summary Get the decade of the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Get the decade of the given date.
|
10 |
+
*
|
11 |
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
12 |
+
*
|
13 |
+
* @param date - The given date
|
14 |
+
*
|
15 |
+
* @returns The year of decade
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Which decade belongs 27 November 1942?
|
19 |
+
* const result = getDecade(new Date(1942, 10, 27))
|
20 |
+
* //=> 1940
|
21 |
+
*/
|
22 |
+
export function getDecade(date) {
|
23 |
+
// TODO: Switch to more technical definition in of decades that start with 1
|
24 |
+
// end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking
|
25 |
+
// change, so it can only be done in 4.0.
|
26 |
+
const _date = toDate(date);
|
27 |
+
const year = _date.getFullYear();
|
28 |
+
const decade = Math.floor(year / 10) * 10;
|
29 |
+
return decade;
|
30 |
+
}
|
31 |
+
|
32 |
+
// Fallback for modularized imports:
|
33 |
+
export default getDecade;
|
workers1/auto3d/node_modules/date-fns/getDefaultOptions.d.mts
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { DefaultOptions } from "./_lib/defaultOptions.js";
|
2 |
+
/**
|
3 |
+
* @name getDefaultOptions
|
4 |
+
* @category Common Helpers
|
5 |
+
* @summary Get default options.
|
6 |
+
* @pure false
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Returns an object that contains defaults for
|
10 |
+
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
|
11 |
+
* arguments for all functions.
|
12 |
+
*
|
13 |
+
* You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).
|
14 |
+
*
|
15 |
+
* @returns The default options
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* const result = getDefaultOptions()
|
19 |
+
* //=> {}
|
20 |
+
*
|
21 |
+
* @example
|
22 |
+
* setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })
|
23 |
+
* const result = getDefaultOptions()
|
24 |
+
* //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }
|
25 |
+
*/
|
26 |
+
export declare function getDefaultOptions(): DefaultOptions;
|
workers1/auto3d/node_modules/date-fns/getDefaultOptions.d.ts
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { DefaultOptions } from "./_lib/defaultOptions.js";
|
2 |
+
/**
|
3 |
+
* @name getDefaultOptions
|
4 |
+
* @category Common Helpers
|
5 |
+
* @summary Get default options.
|
6 |
+
* @pure false
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Returns an object that contains defaults for
|
10 |
+
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
|
11 |
+
* arguments for all functions.
|
12 |
+
*
|
13 |
+
* You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).
|
14 |
+
*
|
15 |
+
* @returns The default options
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* const result = getDefaultOptions()
|
19 |
+
* //=> {}
|
20 |
+
*
|
21 |
+
* @example
|
22 |
+
* setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })
|
23 |
+
* const result = getDefaultOptions()
|
24 |
+
* //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }
|
25 |
+
*/
|
26 |
+
export declare function getDefaultOptions(): DefaultOptions;
|
workers1/auto3d/node_modules/date-fns/getDefaultOptions.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getDefaultOptions = getDefaultOptions;
|
3 |
+
|
4 |
+
var _index = require("./_lib/defaultOptions.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name getDefaultOptions
|
8 |
+
* @category Common Helpers
|
9 |
+
* @summary Get default options.
|
10 |
+
* @pure false
|
11 |
+
*
|
12 |
+
* @description
|
13 |
+
* Returns an object that contains defaults for
|
14 |
+
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
|
15 |
+
* arguments for all functions.
|
16 |
+
*
|
17 |
+
* You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).
|
18 |
+
*
|
19 |
+
* @returns The default options
|
20 |
+
*
|
21 |
+
* @example
|
22 |
+
* const result = getDefaultOptions()
|
23 |
+
* //=> {}
|
24 |
+
*
|
25 |
+
* @example
|
26 |
+
* setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })
|
27 |
+
* const result = getDefaultOptions()
|
28 |
+
* //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }
|
29 |
+
*/
|
30 |
+
function getDefaultOptions() {
|
31 |
+
return Object.assign({}, (0, _index.getDefaultOptions)());
|
32 |
+
}
|
workers1/auto3d/node_modules/date-fns/getDefaultOptions.mjs
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getDefaultOptions as getInternalDefaultOptions } from "./_lib/defaultOptions.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name getDefaultOptions
|
5 |
+
* @category Common Helpers
|
6 |
+
* @summary Get default options.
|
7 |
+
* @pure false
|
8 |
+
*
|
9 |
+
* @description
|
10 |
+
* Returns an object that contains defaults for
|
11 |
+
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
|
12 |
+
* arguments for all functions.
|
13 |
+
*
|
14 |
+
* You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).
|
15 |
+
*
|
16 |
+
* @returns The default options
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* const result = getDefaultOptions()
|
20 |
+
* //=> {}
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })
|
24 |
+
* const result = getDefaultOptions()
|
25 |
+
* //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }
|
26 |
+
*/
|
27 |
+
export function getDefaultOptions() {
|
28 |
+
return Object.assign({}, getInternalDefaultOptions());
|
29 |
+
}
|
30 |
+
|
31 |
+
// Fallback for modularized imports:
|
32 |
+
export default getDefaultOptions;
|
workers1/auto3d/node_modules/date-fns/getHours.d.mts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getHours
|
3 |
+
* @category Hour Helpers
|
4 |
+
* @summary Get the hours of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the hours of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The hours
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Get the hours of 29 February 2012 11:45:00:
|
17 |
+
* const result = getHours(new Date(2012, 1, 29, 11, 45))
|
18 |
+
* //=> 11
|
19 |
+
*/
|
20 |
+
export declare function getHours<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getHours.d.ts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getHours
|
3 |
+
* @category Hour Helpers
|
4 |
+
* @summary Get the hours of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the hours of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The hours
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Get the hours of 29 February 2012 11:45:00:
|
17 |
+
* const result = getHours(new Date(2012, 1, 29, 11, 45))
|
18 |
+
* //=> 11
|
19 |
+
*/
|
20 |
+
export declare function getHours<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getHours.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getHours = getHours;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name getHours
|
7 |
+
* @category Hour Helpers
|
8 |
+
* @summary Get the hours of the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the hours of 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 given date
|
16 |
+
*
|
17 |
+
* @returns The hours
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Get the hours of 29 February 2012 11:45:00:
|
21 |
+
* const result = getHours(new Date(2012, 1, 29, 11, 45))
|
22 |
+
* //=> 11
|
23 |
+
*/
|
24 |
+
function getHours(date) {
|
25 |
+
const _date = (0, _index.toDate)(date);
|
26 |
+
const hours = _date.getHours();
|
27 |
+
return hours;
|
28 |
+
}
|
workers1/auto3d/node_modules/date-fns/getHours.mjs
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name getHours
|
5 |
+
* @category Hour Helpers
|
6 |
+
* @summary Get the hours of the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Get the hours of the given date.
|
10 |
+
*
|
11 |
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
12 |
+
*
|
13 |
+
* @param date - The given date
|
14 |
+
*
|
15 |
+
* @returns The hours
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Get the hours of 29 February 2012 11:45:00:
|
19 |
+
* const result = getHours(new Date(2012, 1, 29, 11, 45))
|
20 |
+
* //=> 11
|
21 |
+
*/
|
22 |
+
export function getHours(date) {
|
23 |
+
const _date = toDate(date);
|
24 |
+
const hours = _date.getHours();
|
25 |
+
return hours;
|
26 |
+
}
|
27 |
+
|
28 |
+
// Fallback for modularized imports:
|
29 |
+
export default getHours;
|
workers1/auto3d/node_modules/date-fns/getISODay.d.mts
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getISODay
|
3 |
+
* @category Weekday Helpers
|
4 |
+
* @summary Get the day of the ISO week of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the day of the ISO week of the given date,
|
8 |
+
* which is 7 for Sunday, 1 for Monday etc.
|
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 given date
|
15 |
+
*
|
16 |
+
* @returns The day of ISO week
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Which day of the ISO week is 26 February 2012?
|
20 |
+
* const result = getISODay(new Date(2012, 1, 26))
|
21 |
+
* //=> 7
|
22 |
+
*/
|
23 |
+
export declare function getISODay<DateType extends Date>(
|
24 |
+
date: DateType | number | string,
|
25 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getISODay.d.ts
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getISODay
|
3 |
+
* @category Weekday Helpers
|
4 |
+
* @summary Get the day of the ISO week of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the day of the ISO week of the given date,
|
8 |
+
* which is 7 for Sunday, 1 for Monday etc.
|
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 given date
|
15 |
+
*
|
16 |
+
* @returns The day of ISO week
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Which day of the ISO week is 26 February 2012?
|
20 |
+
* const result = getISODay(new Date(2012, 1, 26))
|
21 |
+
* //=> 7
|
22 |
+
*/
|
23 |
+
export declare function getISODay<DateType extends Date>(
|
24 |
+
date: DateType | number | string,
|
25 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getISODay.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getISODay = getISODay;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name getISODay
|
7 |
+
* @category Weekday Helpers
|
8 |
+
* @summary Get the day of the ISO week of the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the day of the ISO week of the given date,
|
12 |
+
* which is 7 for Sunday, 1 for Monday etc.
|
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 given date
|
19 |
+
*
|
20 |
+
* @returns The day of ISO week
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // Which day of the ISO week is 26 February 2012?
|
24 |
+
* const result = getISODay(new Date(2012, 1, 26))
|
25 |
+
* //=> 7
|
26 |
+
*/
|
27 |
+
function getISODay(date) {
|
28 |
+
const _date = (0, _index.toDate)(date);
|
29 |
+
let day = _date.getDay();
|
30 |
+
|
31 |
+
if (day === 0) {
|
32 |
+
day = 7;
|
33 |
+
}
|
34 |
+
|
35 |
+
return day;
|
36 |
+
}
|
workers1/auto3d/node_modules/date-fns/getISODay.mjs
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name getISODay
|
5 |
+
* @category Weekday Helpers
|
6 |
+
* @summary Get the day of the ISO week of the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Get the day of the ISO week of the given date,
|
10 |
+
* which is 7 for Sunday, 1 for Monday etc.
|
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 given date
|
17 |
+
*
|
18 |
+
* @returns The day of ISO week
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // Which day of the ISO week is 26 February 2012?
|
22 |
+
* const result = getISODay(new Date(2012, 1, 26))
|
23 |
+
* //=> 7
|
24 |
+
*/
|
25 |
+
export function getISODay(date) {
|
26 |
+
const _date = toDate(date);
|
27 |
+
let day = _date.getDay();
|
28 |
+
|
29 |
+
if (day === 0) {
|
30 |
+
day = 7;
|
31 |
+
}
|
32 |
+
|
33 |
+
return day;
|
34 |
+
}
|
35 |
+
|
36 |
+
// Fallback for modularized imports:
|
37 |
+
export default getISODay;
|
workers1/auto3d/node_modules/date-fns/getISOWeek.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getISOWeek
|
3 |
+
* @category ISO Week Helpers
|
4 |
+
* @summary Get the ISO week of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the ISO week of the given date.
|
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 given date
|
14 |
+
*
|
15 |
+
* @returns The ISO week
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Which week of the ISO-week numbering year is 2 January 2005?
|
19 |
+
* const result = getISOWeek(new Date(2005, 0, 2))
|
20 |
+
* //=> 53
|
21 |
+
*/
|
22 |
+
export declare function getISOWeek<DateType extends Date>(
|
23 |
+
date: DateType | number | string,
|
24 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getISOWeek.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getISOWeek
|
3 |
+
* @category ISO Week Helpers
|
4 |
+
* @summary Get the ISO week of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the ISO week of the given date.
|
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 given date
|
14 |
+
*
|
15 |
+
* @returns The ISO week
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Which week of the ISO-week numbering year is 2 January 2005?
|
19 |
+
* const result = getISOWeek(new Date(2005, 0, 2))
|
20 |
+
* //=> 53
|
21 |
+
*/
|
22 |
+
export declare function getISOWeek<DateType extends Date>(
|
23 |
+
date: DateType | number | string,
|
24 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getISOWeek.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getISOWeek = getISOWeek;
|
3 |
+
var _index = require("./constants.js");
|
4 |
+
var _index2 = require("./startOfISOWeek.js");
|
5 |
+
var _index3 = require("./startOfISOWeekYear.js");
|
6 |
+
var _index4 = require("./toDate.js");
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @name getISOWeek
|
10 |
+
* @category ISO Week Helpers
|
11 |
+
* @summary Get the ISO week of the given date.
|
12 |
+
*
|
13 |
+
* @description
|
14 |
+
* Get the ISO week of the given date.
|
15 |
+
*
|
16 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
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 given date
|
21 |
+
*
|
22 |
+
* @returns The ISO week
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // Which week of the ISO-week numbering year is 2 January 2005?
|
26 |
+
* const result = getISOWeek(new Date(2005, 0, 2))
|
27 |
+
* //=> 53
|
28 |
+
*/
|
29 |
+
function getISOWeek(date) {
|
30 |
+
const _date = (0, _index4.toDate)(date);
|
31 |
+
const diff =
|
32 |
+
+(0, _index2.startOfISOWeek)(_date) -
|
33 |
+
+(0, _index3.startOfISOWeekYear)(_date);
|
34 |
+
|
35 |
+
// Round the number of weeks to the nearest integer because the number of
|
36 |
+
// milliseconds in a week is not constant (e.g. it's different in the week of
|
37 |
+
// the daylight saving time clock shift).
|
38 |
+
return Math.round(diff / _index.millisecondsInWeek) + 1;
|
39 |
+
}
|
workers1/auto3d/node_modules/date-fns/getISOWeek.mjs
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { millisecondsInWeek } from "./constants.mjs";
|
2 |
+
import { startOfISOWeek } from "./startOfISOWeek.mjs";
|
3 |
+
import { startOfISOWeekYear } from "./startOfISOWeekYear.mjs";
|
4 |
+
import { toDate } from "./toDate.mjs";
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name getISOWeek
|
8 |
+
* @category ISO Week Helpers
|
9 |
+
* @summary Get the ISO week of the given date.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the ISO week of the given date.
|
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 given date
|
19 |
+
*
|
20 |
+
* @returns The ISO week
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // Which week of the ISO-week numbering year is 2 January 2005?
|
24 |
+
* const result = getISOWeek(new Date(2005, 0, 2))
|
25 |
+
* //=> 53
|
26 |
+
*/
|
27 |
+
export function getISOWeek(date) {
|
28 |
+
const _date = toDate(date);
|
29 |
+
const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
|
30 |
+
|
31 |
+
// Round the number of weeks to the nearest integer because the number of
|
32 |
+
// milliseconds in a week is not constant (e.g. it's different in the week of
|
33 |
+
// the daylight saving time clock shift).
|
34 |
+
return Math.round(diff / millisecondsInWeek) + 1;
|
35 |
+
}
|
36 |
+
|
37 |
+
// Fallback for modularized imports:
|
38 |
+
export default getISOWeek;
|
workers1/auto3d/node_modules/date-fns/getISOWeekYear.d.mts
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getISOWeekYear
|
3 |
+
* @category ISO Week-Numbering Year Helpers
|
4 |
+
* @summary Get the ISO week-numbering year of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the ISO week-numbering year of the given date,
|
8 |
+
* which always starts 3 days before the year's first Thursday.
|
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 given date
|
15 |
+
*
|
16 |
+
* @returns The ISO week-numbering year
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Which ISO-week numbering year is 2 January 2005?
|
20 |
+
* const result = getISOWeekYear(new Date(2005, 0, 2))
|
21 |
+
* //=> 2004
|
22 |
+
*/
|
23 |
+
export declare function getISOWeekYear<DateType extends Date>(
|
24 |
+
date: DateType | number | string,
|
25 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getISOWeekYear.d.ts
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getISOWeekYear
|
3 |
+
* @category ISO Week-Numbering Year Helpers
|
4 |
+
* @summary Get the ISO week-numbering year of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the ISO week-numbering year of the given date,
|
8 |
+
* which always starts 3 days before the year's first Thursday.
|
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 given date
|
15 |
+
*
|
16 |
+
* @returns The ISO week-numbering year
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // Which ISO-week numbering year is 2 January 2005?
|
20 |
+
* const result = getISOWeekYear(new Date(2005, 0, 2))
|
21 |
+
* //=> 2004
|
22 |
+
*/
|
23 |
+
export declare function getISOWeekYear<DateType extends Date>(
|
24 |
+
date: DateType | number | string,
|
25 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getISOWeekYear.js
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getISOWeekYear = getISOWeekYear;
|
3 |
+
var _index = require("./constructFrom.js");
|
4 |
+
var _index2 = require("./startOfISOWeek.js");
|
5 |
+
var _index3 = require("./toDate.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @name getISOWeekYear
|
9 |
+
* @category ISO Week-Numbering Year Helpers
|
10 |
+
* @summary Get the ISO week-numbering year of the given date.
|
11 |
+
*
|
12 |
+
* @description
|
13 |
+
* Get the ISO week-numbering year of the given date,
|
14 |
+
* which always starts 3 days before the year's first Thursday.
|
15 |
+
*
|
16 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
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 given date
|
21 |
+
*
|
22 |
+
* @returns The ISO week-numbering year
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // Which ISO-week numbering year is 2 January 2005?
|
26 |
+
* const result = getISOWeekYear(new Date(2005, 0, 2))
|
27 |
+
* //=> 2004
|
28 |
+
*/
|
29 |
+
function getISOWeekYear(date) {
|
30 |
+
const _date = (0, _index3.toDate)(date);
|
31 |
+
const year = _date.getFullYear();
|
32 |
+
|
33 |
+
const fourthOfJanuaryOfNextYear = (0, _index.constructFrom)(date, 0);
|
34 |
+
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
35 |
+
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
36 |
+
const startOfNextYear = (0, _index2.startOfISOWeek)(
|
37 |
+
fourthOfJanuaryOfNextYear,
|
38 |
+
);
|
39 |
+
|
40 |
+
const fourthOfJanuaryOfThisYear = (0, _index.constructFrom)(date, 0);
|
41 |
+
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
|
42 |
+
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
|
43 |
+
const startOfThisYear = (0, _index2.startOfISOWeek)(
|
44 |
+
fourthOfJanuaryOfThisYear,
|
45 |
+
);
|
46 |
+
|
47 |
+
if (_date.getTime() >= startOfNextYear.getTime()) {
|
48 |
+
return year + 1;
|
49 |
+
} else if (_date.getTime() >= startOfThisYear.getTime()) {
|
50 |
+
return year;
|
51 |
+
} else {
|
52 |
+
return year - 1;
|
53 |
+
}
|
54 |
+
}
|
workers1/auto3d/node_modules/date-fns/getISOWeekYear.mjs
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { constructFrom } from "./constructFrom.mjs";
|
2 |
+
import { startOfISOWeek } from "./startOfISOWeek.mjs";
|
3 |
+
import { toDate } from "./toDate.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name getISOWeekYear
|
7 |
+
* @category ISO Week-Numbering Year Helpers
|
8 |
+
* @summary Get the ISO week-numbering year of the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the ISO week-numbering year of the given date,
|
12 |
+
* which always starts 3 days before the year's first Thursday.
|
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 given date
|
19 |
+
*
|
20 |
+
* @returns The ISO week-numbering year
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // Which ISO-week numbering year is 2 January 2005?
|
24 |
+
* const result = getISOWeekYear(new Date(2005, 0, 2))
|
25 |
+
* //=> 2004
|
26 |
+
*/
|
27 |
+
export function getISOWeekYear(date) {
|
28 |
+
const _date = toDate(date);
|
29 |
+
const year = _date.getFullYear();
|
30 |
+
|
31 |
+
const fourthOfJanuaryOfNextYear = constructFrom(date, 0);
|
32 |
+
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
33 |
+
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
34 |
+
const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
|
35 |
+
|
36 |
+
const fourthOfJanuaryOfThisYear = constructFrom(date, 0);
|
37 |
+
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
|
38 |
+
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
|
39 |
+
const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
|
40 |
+
|
41 |
+
if (_date.getTime() >= startOfNextYear.getTime()) {
|
42 |
+
return year + 1;
|
43 |
+
} else if (_date.getTime() >= startOfThisYear.getTime()) {
|
44 |
+
return year;
|
45 |
+
} else {
|
46 |
+
return year - 1;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
// Fallback for modularized imports:
|
51 |
+
export default getISOWeekYear;
|
workers1/auto3d/node_modules/date-fns/getISOWeeksInYear.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getISOWeeksInYear
|
3 |
+
* @category ISO Week-Numbering Year Helpers
|
4 |
+
* @summary Get the number of weeks in an ISO week-numbering year of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of weeks in an ISO week-numbering year of the given date.
|
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 given date
|
14 |
+
*
|
15 |
+
* @returns The number of ISO weeks in a year
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // How many weeks are in ISO week-numbering year 2015?
|
19 |
+
* const result = getISOWeeksInYear(new Date(2015, 1, 11))
|
20 |
+
* //=> 53
|
21 |
+
*/
|
22 |
+
export declare function getISOWeeksInYear<DateType extends Date>(
|
23 |
+
date: DateType | number | string,
|
24 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getISOWeeksInYear.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getISOWeeksInYear
|
3 |
+
* @category ISO Week-Numbering Year Helpers
|
4 |
+
* @summary Get the number of weeks in an ISO week-numbering year of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of weeks in an ISO week-numbering year of the given date.
|
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 given date
|
14 |
+
*
|
15 |
+
* @returns The number of ISO weeks in a year
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // How many weeks are in ISO week-numbering year 2015?
|
19 |
+
* const result = getISOWeeksInYear(new Date(2015, 1, 11))
|
20 |
+
* //=> 53
|
21 |
+
*/
|
22 |
+
export declare function getISOWeeksInYear<DateType extends Date>(
|
23 |
+
date: DateType | number | string,
|
24 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getISOWeeksInYear.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getISOWeeksInYear = getISOWeeksInYear;
|
3 |
+
var _index = require("./addWeeks.js");
|
4 |
+
var _index2 = require("./constants.js");
|
5 |
+
var _index3 = require("./startOfISOWeekYear.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @name getISOWeeksInYear
|
9 |
+
* @category ISO Week-Numbering Year Helpers
|
10 |
+
* @summary Get the number of weeks in an ISO week-numbering year of the given date.
|
11 |
+
*
|
12 |
+
* @description
|
13 |
+
* Get the number of weeks in an ISO week-numbering year of the given date.
|
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 given date
|
20 |
+
*
|
21 |
+
* @returns The number of ISO weeks in a year
|
22 |
+
*
|
23 |
+
* @example
|
24 |
+
* // How many weeks are in ISO week-numbering year 2015?
|
25 |
+
* const result = getISOWeeksInYear(new Date(2015, 1, 11))
|
26 |
+
* //=> 53
|
27 |
+
*/
|
28 |
+
function getISOWeeksInYear(date) {
|
29 |
+
const thisYear = (0, _index3.startOfISOWeekYear)(date);
|
30 |
+
const nextYear = (0, _index3.startOfISOWeekYear)(
|
31 |
+
(0, _index.addWeeks)(thisYear, 60),
|
32 |
+
);
|
33 |
+
const diff = +nextYear - +thisYear;
|
34 |
+
|
35 |
+
// Round the number of weeks to the nearest integer because the number of
|
36 |
+
// milliseconds in a week is not constant (e.g. it's different in the week of
|
37 |
+
// the daylight saving time clock shift).
|
38 |
+
return Math.round(diff / _index2.millisecondsInWeek);
|
39 |
+
}
|
workers1/auto3d/node_modules/date-fns/getISOWeeksInYear.mjs
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { addWeeks } from "./addWeeks.mjs";
|
2 |
+
import { millisecondsInWeek } from "./constants.mjs";
|
3 |
+
import { startOfISOWeekYear } from "./startOfISOWeekYear.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name getISOWeeksInYear
|
7 |
+
* @category ISO Week-Numbering Year Helpers
|
8 |
+
* @summary Get the number of weeks in an ISO week-numbering year of the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the number of weeks in an ISO week-numbering year of the given date.
|
12 |
+
*
|
13 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_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 given date
|
18 |
+
*
|
19 |
+
* @returns The number of ISO weeks in a year
|
20 |
+
*
|
21 |
+
* @example
|
22 |
+
* // How many weeks are in ISO week-numbering year 2015?
|
23 |
+
* const result = getISOWeeksInYear(new Date(2015, 1, 11))
|
24 |
+
* //=> 53
|
25 |
+
*/
|
26 |
+
export function getISOWeeksInYear(date) {
|
27 |
+
const thisYear = startOfISOWeekYear(date);
|
28 |
+
const nextYear = startOfISOWeekYear(addWeeks(thisYear, 60));
|
29 |
+
const diff = +nextYear - +thisYear;
|
30 |
+
|
31 |
+
// Round the number of weeks to the nearest integer because the number of
|
32 |
+
// milliseconds in a week is not constant (e.g. it's different in the week of
|
33 |
+
// the daylight saving time clock shift).
|
34 |
+
return Math.round(diff / millisecondsInWeek);
|
35 |
+
}
|
36 |
+
|
37 |
+
// Fallback for modularized imports:
|
38 |
+
export default getISOWeeksInYear;
|
workers1/auto3d/node_modules/date-fns/getMilliseconds.d.mts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getMilliseconds
|
3 |
+
* @category Millisecond Helpers
|
4 |
+
* @summary Get the milliseconds of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the milliseconds of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The milliseconds
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Get the milliseconds of 29 February 2012 11:45:05.123:
|
17 |
+
* const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))
|
18 |
+
* //=> 123
|
19 |
+
*/
|
20 |
+
export declare function getMilliseconds<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getMilliseconds.d.ts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getMilliseconds
|
3 |
+
* @category Millisecond Helpers
|
4 |
+
* @summary Get the milliseconds of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the milliseconds of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The milliseconds
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Get the milliseconds of 29 February 2012 11:45:05.123:
|
17 |
+
* const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))
|
18 |
+
* //=> 123
|
19 |
+
*/
|
20 |
+
export declare function getMilliseconds<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getMilliseconds.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getMilliseconds = getMilliseconds;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name getMilliseconds
|
7 |
+
* @category Millisecond Helpers
|
8 |
+
* @summary Get the milliseconds of the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the milliseconds of 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 given date
|
16 |
+
*
|
17 |
+
* @returns The milliseconds
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Get the milliseconds of 29 February 2012 11:45:05.123:
|
21 |
+
* const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))
|
22 |
+
* //=> 123
|
23 |
+
*/
|
24 |
+
function getMilliseconds(date) {
|
25 |
+
const _date = (0, _index.toDate)(date);
|
26 |
+
const milliseconds = _date.getMilliseconds();
|
27 |
+
return milliseconds;
|
28 |
+
}
|
workers1/auto3d/node_modules/date-fns/getMilliseconds.mjs
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name getMilliseconds
|
5 |
+
* @category Millisecond Helpers
|
6 |
+
* @summary Get the milliseconds of the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Get the milliseconds of the given date.
|
10 |
+
*
|
11 |
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
12 |
+
*
|
13 |
+
* @param date - The given date
|
14 |
+
*
|
15 |
+
* @returns The milliseconds
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Get the milliseconds of 29 February 2012 11:45:05.123:
|
19 |
+
* const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))
|
20 |
+
* //=> 123
|
21 |
+
*/
|
22 |
+
export function getMilliseconds(date) {
|
23 |
+
const _date = toDate(date);
|
24 |
+
const milliseconds = _date.getMilliseconds();
|
25 |
+
return milliseconds;
|
26 |
+
}
|
27 |
+
|
28 |
+
// Fallback for modularized imports:
|
29 |
+
export default getMilliseconds;
|
workers1/auto3d/node_modules/date-fns/getMinutes.d.mts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getMinutes
|
3 |
+
* @category Minute Helpers
|
4 |
+
* @summary Get the minutes of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the minutes of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The minutes
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Get the minutes of 29 February 2012 11:45:05:
|
17 |
+
* const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))
|
18 |
+
* //=> 45
|
19 |
+
*/
|
20 |
+
export declare function getMinutes<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getMinutes.d.ts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getMinutes
|
3 |
+
* @category Minute Helpers
|
4 |
+
* @summary Get the minutes of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the minutes of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The minutes
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Get the minutes of 29 February 2012 11:45:05:
|
17 |
+
* const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))
|
18 |
+
* //=> 45
|
19 |
+
*/
|
20 |
+
export declare function getMinutes<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getMinutes.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getMinutes = getMinutes;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name getMinutes
|
7 |
+
* @category Minute Helpers
|
8 |
+
* @summary Get the minutes of the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the minutes of 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 given date
|
16 |
+
*
|
17 |
+
* @returns The minutes
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Get the minutes of 29 February 2012 11:45:05:
|
21 |
+
* const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))
|
22 |
+
* //=> 45
|
23 |
+
*/
|
24 |
+
function getMinutes(date) {
|
25 |
+
const _date = (0, _index.toDate)(date);
|
26 |
+
const minutes = _date.getMinutes();
|
27 |
+
return minutes;
|
28 |
+
}
|
workers1/auto3d/node_modules/date-fns/getMinutes.mjs
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name getMinutes
|
5 |
+
* @category Minute Helpers
|
6 |
+
* @summary Get the minutes of the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Get the minutes of the given date.
|
10 |
+
*
|
11 |
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
12 |
+
*
|
13 |
+
* @param date - The given date
|
14 |
+
*
|
15 |
+
* @returns The minutes
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Get the minutes of 29 February 2012 11:45:05:
|
19 |
+
* const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))
|
20 |
+
* //=> 45
|
21 |
+
*/
|
22 |
+
export function getMinutes(date) {
|
23 |
+
const _date = toDate(date);
|
24 |
+
const minutes = _date.getMinutes();
|
25 |
+
return minutes;
|
26 |
+
}
|
27 |
+
|
28 |
+
// Fallback for modularized imports:
|
29 |
+
export default getMinutes;
|
workers1/auto3d/node_modules/date-fns/getMonth.d.mts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getMonth
|
3 |
+
* @category Month Helpers
|
4 |
+
* @summary Get the month of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the month of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The month index (0-11)
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Which month is 29 February 2012?
|
17 |
+
* const result = getMonth(new Date(2012, 1, 29))
|
18 |
+
* //=> 1
|
19 |
+
*/
|
20 |
+
export declare function getMonth<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getMonth.d.ts
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name getMonth
|
3 |
+
* @category Month Helpers
|
4 |
+
* @summary Get the month of the given date.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the month of 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 given date
|
12 |
+
*
|
13 |
+
* @returns The month index (0-11)
|
14 |
+
*
|
15 |
+
* @example
|
16 |
+
* // Which month is 29 February 2012?
|
17 |
+
* const result = getMonth(new Date(2012, 1, 29))
|
18 |
+
* //=> 1
|
19 |
+
*/
|
20 |
+
export declare function getMonth<DateType extends Date>(
|
21 |
+
date: DateType | number | string,
|
22 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getMonth.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getMonth = getMonth;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name getMonth
|
7 |
+
* @category Month Helpers
|
8 |
+
* @summary Get the month of the given date.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the month of 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 given date
|
16 |
+
*
|
17 |
+
* @returns The month index (0-11)
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // Which month is 29 February 2012?
|
21 |
+
* const result = getMonth(new Date(2012, 1, 29))
|
22 |
+
* //=> 1
|
23 |
+
*/
|
24 |
+
function getMonth(date) {
|
25 |
+
const _date = (0, _index.toDate)(date);
|
26 |
+
const month = _date.getMonth();
|
27 |
+
return month;
|
28 |
+
}
|
workers1/auto3d/node_modules/date-fns/getMonth.mjs
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name getMonth
|
5 |
+
* @category Month Helpers
|
6 |
+
* @summary Get the month of the given date.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Get the month of the given date.
|
10 |
+
*
|
11 |
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
12 |
+
*
|
13 |
+
* @param date - The given date
|
14 |
+
*
|
15 |
+
* @returns The month index (0-11)
|
16 |
+
*
|
17 |
+
* @example
|
18 |
+
* // Which month is 29 February 2012?
|
19 |
+
* const result = getMonth(new Date(2012, 1, 29))
|
20 |
+
* //=> 1
|
21 |
+
*/
|
22 |
+
export function getMonth(date) {
|
23 |
+
const _date = toDate(date);
|
24 |
+
const month = _date.getMonth();
|
25 |
+
return month;
|
26 |
+
}
|
27 |
+
|
28 |
+
// Fallback for modularized imports:
|
29 |
+
export default getMonth;
|
workers1/auto3d/node_modules/date-fns/getOverlappingDaysInIntervals.d.mts
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Interval } from "./types.js";
|
2 |
+
/**
|
3 |
+
* @name getOverlappingDaysInIntervals
|
4 |
+
* @category Interval Helpers
|
5 |
+
* @summary Get the number of days that overlap in two time intervals
|
6 |
+
*
|
7 |
+
* @description
|
8 |
+
* Get the number of days that overlap in two time intervals. It uses the time
|
9 |
+
* between dates to calculate the number of days, rounding it up to include
|
10 |
+
* partial days.
|
11 |
+
*
|
12 |
+
* Two equal 0-length intervals will result in 0. Two equal 1ms intervals will
|
13 |
+
* result in 1.
|
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 intervalLeft - The first interval to compare.
|
18 |
+
* @param intervalRight - The second interval to compare.
|
19 |
+
*
|
20 |
+
* @returns The number of days that overlap in two time intervals
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // For overlapping time intervals adds 1 for each started overlapping day:
|
24 |
+
* getOverlappingDaysInIntervals(
|
25 |
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
26 |
+
* { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
|
27 |
+
* )
|
28 |
+
* //=> 3
|
29 |
+
*
|
30 |
+
* @example
|
31 |
+
* // For non-overlapping time intervals returns 0:
|
32 |
+
* getOverlappingDaysInIntervals(
|
33 |
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
34 |
+
* { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
|
35 |
+
* )
|
36 |
+
* //=> 0
|
37 |
+
*/
|
38 |
+
export declare function getOverlappingDaysInIntervals<DateType extends Date>(
|
39 |
+
intervalLeft: Interval<DateType>,
|
40 |
+
intervalRight: Interval<DateType>,
|
41 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getOverlappingDaysInIntervals.d.ts
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Interval } from "./types.js";
|
2 |
+
/**
|
3 |
+
* @name getOverlappingDaysInIntervals
|
4 |
+
* @category Interval Helpers
|
5 |
+
* @summary Get the number of days that overlap in two time intervals
|
6 |
+
*
|
7 |
+
* @description
|
8 |
+
* Get the number of days that overlap in two time intervals. It uses the time
|
9 |
+
* between dates to calculate the number of days, rounding it up to include
|
10 |
+
* partial days.
|
11 |
+
*
|
12 |
+
* Two equal 0-length intervals will result in 0. Two equal 1ms intervals will
|
13 |
+
* result in 1.
|
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 intervalLeft - The first interval to compare.
|
18 |
+
* @param intervalRight - The second interval to compare.
|
19 |
+
*
|
20 |
+
* @returns The number of days that overlap in two time intervals
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // For overlapping time intervals adds 1 for each started overlapping day:
|
24 |
+
* getOverlappingDaysInIntervals(
|
25 |
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
26 |
+
* { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
|
27 |
+
* )
|
28 |
+
* //=> 3
|
29 |
+
*
|
30 |
+
* @example
|
31 |
+
* // For non-overlapping time intervals returns 0:
|
32 |
+
* getOverlappingDaysInIntervals(
|
33 |
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
34 |
+
* { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
|
35 |
+
* )
|
36 |
+
* //=> 0
|
37 |
+
*/
|
38 |
+
export declare function getOverlappingDaysInIntervals<DateType extends Date>(
|
39 |
+
intervalLeft: Interval<DateType>,
|
40 |
+
intervalRight: Interval<DateType>,
|
41 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/getOverlappingDaysInIntervals.js
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.getOverlappingDaysInIntervals = getOverlappingDaysInIntervals;
|
3 |
+
var _index = require("./_lib/getTimezoneOffsetInMilliseconds.js");
|
4 |
+
var _index2 = require("./constants.js");
|
5 |
+
var _index3 = require("./toDate.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @name getOverlappingDaysInIntervals
|
9 |
+
* @category Interval Helpers
|
10 |
+
* @summary Get the number of days that overlap in two time intervals
|
11 |
+
*
|
12 |
+
* @description
|
13 |
+
* Get the number of days that overlap in two time intervals. It uses the time
|
14 |
+
* between dates to calculate the number of days, rounding it up to include
|
15 |
+
* partial days.
|
16 |
+
*
|
17 |
+
* Two equal 0-length intervals will result in 0. Two equal 1ms intervals will
|
18 |
+
* result in 1.
|
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 intervalLeft - The first interval to compare.
|
23 |
+
* @param intervalRight - The second interval to compare.
|
24 |
+
*
|
25 |
+
* @returns The number of days that overlap in two time intervals
|
26 |
+
*
|
27 |
+
* @example
|
28 |
+
* // For overlapping time intervals adds 1 for each started overlapping day:
|
29 |
+
* getOverlappingDaysInIntervals(
|
30 |
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
31 |
+
* { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
|
32 |
+
* )
|
33 |
+
* //=> 3
|
34 |
+
*
|
35 |
+
* @example
|
36 |
+
* // For non-overlapping time intervals returns 0:
|
37 |
+
* getOverlappingDaysInIntervals(
|
38 |
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
39 |
+
* { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
|
40 |
+
* )
|
41 |
+
* //=> 0
|
42 |
+
*/
|
43 |
+
|
44 |
+
function getOverlappingDaysInIntervals(intervalLeft, intervalRight) {
|
45 |
+
const [leftStart, leftEnd] = [
|
46 |
+
+(0, _index3.toDate)(intervalLeft.start),
|
47 |
+
+(0, _index3.toDate)(intervalLeft.end),
|
48 |
+
].sort((a, b) => a - b);
|
49 |
+
const [rightStart, rightEnd] = [
|
50 |
+
+(0, _index3.toDate)(intervalRight.start),
|
51 |
+
+(0, _index3.toDate)(intervalRight.end),
|
52 |
+
].sort((a, b) => a - b);
|
53 |
+
|
54 |
+
// Prevent NaN result if intervals don't overlap at all.
|
55 |
+
const isOverlapping = leftStart < rightEnd && rightStart < leftEnd;
|
56 |
+
if (!isOverlapping) return 0;
|
57 |
+
|
58 |
+
// Remove the timezone offset to negate the DST effect on calculations.
|
59 |
+
const overlapLeft = rightStart < leftStart ? leftStart : rightStart;
|
60 |
+
const left =
|
61 |
+
overlapLeft - (0, _index.getTimezoneOffsetInMilliseconds)(overlapLeft);
|
62 |
+
const overlapRight = rightEnd > leftEnd ? leftEnd : rightEnd;
|
63 |
+
const right =
|
64 |
+
overlapRight - (0, _index.getTimezoneOffsetInMilliseconds)(overlapRight);
|
65 |
+
|
66 |
+
// Ceil the number to include partial days too.
|
67 |
+
return Math.ceil((right - left) / _index2.millisecondsInDay);
|
68 |
+
}
|