Spaces:
Configuration error
Configuration error
luigi12345
commited on
Commit
•
13fd75d
1
Parent(s):
4fd09c1
055546481af798d2e777ea8d9f83a63f25749b73dcdc9b9502f77b748b290a98
Browse files- workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeekYears.js +34 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeekYears.mjs +33 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeeks.d.mts +29 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeeks.d.ts +29 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeeks.js +49 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeeks.mjs +46 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarMonths.d.mts +27 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarMonths.d.ts +27 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarMonths.js +36 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarMonths.mjs +37 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarQuarters.d.mts +27 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarQuarters.d.ts +27 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarQuarters.js +38 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarQuarters.mjs +38 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarWeeks.d.mts +46 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarWeeks.d.ts +46 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarWeeks.js +63 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarWeeks.mjs +59 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarYears.d.mts +27 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarYears.d.ts +27 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarYears.js +33 -0
- workers1/auto3d/node_modules/date-fns/differenceInCalendarYears.mjs +34 -0
- workers1/auto3d/node_modules/date-fns/differenceInDays.d.mts +58 -0
- workers1/auto3d/node_modules/date-fns/differenceInDays.d.ts +58 -0
- workers1/auto3d/node_modules/date-fns/differenceInDays.js +103 -0
- workers1/auto3d/node_modules/date-fns/differenceInDays.mjs +102 -0
- workers1/auto3d/node_modules/date-fns/differenceInHours.d.mts +34 -0
- workers1/auto3d/node_modules/date-fns/differenceInHours.d.ts +34 -0
- workers1/auto3d/node_modules/date-fns/differenceInHours.js +40 -0
- workers1/auto3d/node_modules/date-fns/differenceInHours.mjs +40 -0
- workers1/auto3d/node_modules/date-fns/differenceInISOWeekYears.d.mts +29 -0
- workers1/auto3d/node_modules/date-fns/differenceInISOWeekYears.d.ts +29 -0
- workers1/auto3d/node_modules/date-fns/differenceInISOWeekYears.js +52 -0
- workers1/auto3d/node_modules/date-fns/differenceInISOWeekYears.mjs +53 -0
- workers1/auto3d/node_modules/date-fns/differenceInMilliseconds.d.mts +28 -0
- workers1/auto3d/node_modules/date-fns/differenceInMilliseconds.d.ts +28 -0
- workers1/auto3d/node_modules/date-fns/differenceInMilliseconds.js +31 -0
- workers1/auto3d/node_modules/date-fns/differenceInMilliseconds.mjs +32 -0
- workers1/auto3d/node_modules/date-fns/differenceInMinutes.d.mts +42 -0
- workers1/auto3d/node_modules/date-fns/differenceInMinutes.d.ts +42 -0
- workers1/auto3d/node_modules/date-fns/differenceInMinutes.js +48 -0
- workers1/auto3d/node_modules/date-fns/differenceInMinutes.mjs +48 -0
- workers1/auto3d/node_modules/date-fns/differenceInMonths.d.mts +24 -0
- workers1/auto3d/node_modules/date-fns/differenceInMonths.d.ts +24 -0
- workers1/auto3d/node_modules/date-fns/differenceInMonths.js +69 -0
- workers1/auto3d/node_modules/date-fns/differenceInMonths.mjs +69 -0
- workers1/auto3d/node_modules/date-fns/differenceInQuarters.d.mts +31 -0
- workers1/auto3d/node_modules/date-fns/differenceInQuarters.d.ts +31 -0
- workers1/auto3d/node_modules/date-fns/differenceInQuarters.js +34 -0
- workers1/auto3d/node_modules/date-fns/differenceInQuarters.mjs +35 -0
workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeekYears.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInCalendarISOWeekYears = differenceInCalendarISOWeekYears;
|
3 |
+
var _index = require("./getISOWeekYear.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name differenceInCalendarISOWeekYears
|
7 |
+
* @category ISO Week-Numbering Year Helpers
|
8 |
+
* @summary Get the number of calendar ISO week-numbering years between the given dates.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the number of calendar ISO week-numbering years between the given dates.
|
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 dateLeft - The later date
|
18 |
+
* @param dateRight - The earlier date
|
19 |
+
*
|
20 |
+
* @returns The number of calendar ISO week-numbering years
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012?
|
24 |
+
* const result = differenceInCalendarISOWeekYears(
|
25 |
+
* new Date(2012, 0, 1),
|
26 |
+
* new Date(2010, 0, 1)
|
27 |
+
* )
|
28 |
+
* //=> 2
|
29 |
+
*/
|
30 |
+
function differenceInCalendarISOWeekYears(dateLeft, dateRight) {
|
31 |
+
return (
|
32 |
+
(0, _index.getISOWeekYear)(dateLeft) - (0, _index.getISOWeekYear)(dateRight)
|
33 |
+
);
|
34 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeekYears.mjs
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getISOWeekYear } from "./getISOWeekYear.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name differenceInCalendarISOWeekYears
|
5 |
+
* @category ISO Week-Numbering Year Helpers
|
6 |
+
* @summary Get the number of calendar ISO week-numbering years between the given dates.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Get the number of calendar ISO week-numbering years between the given dates.
|
10 |
+
*
|
11 |
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_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 dateLeft - The later date
|
16 |
+
* @param dateRight - The earlier date
|
17 |
+
*
|
18 |
+
* @returns The number of calendar ISO week-numbering years
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012?
|
22 |
+
* const result = differenceInCalendarISOWeekYears(
|
23 |
+
* new Date(2012, 0, 1),
|
24 |
+
* new Date(2010, 0, 1)
|
25 |
+
* )
|
26 |
+
* //=> 2
|
27 |
+
*/
|
28 |
+
export function differenceInCalendarISOWeekYears(dateLeft, dateRight) {
|
29 |
+
return getISOWeekYear(dateLeft) - getISOWeekYear(dateRight);
|
30 |
+
}
|
31 |
+
|
32 |
+
// Fallback for modularized imports:
|
33 |
+
export default differenceInCalendarISOWeekYears;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeeks.d.mts
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInCalendarISOWeeks
|
3 |
+
* @category ISO Week Helpers
|
4 |
+
* @summary Get the number of calendar ISO weeks between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of calendar ISO weeks between the given dates.
|
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 dateLeft - The later date
|
14 |
+
* @param dateRight - The earlier date
|
15 |
+
*
|
16 |
+
* @returns The number of calendar ISO weeks
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?
|
20 |
+
* const result = differenceInCalendarISOWeeks(
|
21 |
+
* new Date(2014, 6, 21),
|
22 |
+
* new Date(2014, 6, 6)
|
23 |
+
* )
|
24 |
+
* //=> 3
|
25 |
+
*/
|
26 |
+
export declare function differenceInCalendarISOWeeks<DateType extends Date>(
|
27 |
+
dateLeft: DateType | number | string,
|
28 |
+
dateRight: DateType | number | string,
|
29 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeeks.d.ts
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInCalendarISOWeeks
|
3 |
+
* @category ISO Week Helpers
|
4 |
+
* @summary Get the number of calendar ISO weeks between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of calendar ISO weeks between the given dates.
|
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 dateLeft - The later date
|
14 |
+
* @param dateRight - The earlier date
|
15 |
+
*
|
16 |
+
* @returns The number of calendar ISO weeks
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?
|
20 |
+
* const result = differenceInCalendarISOWeeks(
|
21 |
+
* new Date(2014, 6, 21),
|
22 |
+
* new Date(2014, 6, 6)
|
23 |
+
* )
|
24 |
+
* //=> 3
|
25 |
+
*/
|
26 |
+
export declare function differenceInCalendarISOWeeks<DateType extends Date>(
|
27 |
+
dateLeft: DateType | number | string,
|
28 |
+
dateRight: DateType | number | string,
|
29 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeeks.js
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInCalendarISOWeeks = differenceInCalendarISOWeeks;
|
3 |
+
var _index = require("./constants.js");
|
4 |
+
var _index2 = require("./startOfISOWeek.js");
|
5 |
+
var _index3 = require("./_lib/getTimezoneOffsetInMilliseconds.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @name differenceInCalendarISOWeeks
|
9 |
+
* @category ISO Week Helpers
|
10 |
+
* @summary Get the number of calendar ISO weeks between the given dates.
|
11 |
+
*
|
12 |
+
* @description
|
13 |
+
* Get the number of calendar ISO weeks between the given dates.
|
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 dateLeft - The later date
|
20 |
+
* @param dateRight - The earlier date
|
21 |
+
*
|
22 |
+
* @returns The number of calendar ISO weeks
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?
|
26 |
+
* const result = differenceInCalendarISOWeeks(
|
27 |
+
* new Date(2014, 6, 21),
|
28 |
+
* new Date(2014, 6, 6)
|
29 |
+
* )
|
30 |
+
* //=> 3
|
31 |
+
*/
|
32 |
+
function differenceInCalendarISOWeeks(dateLeft, dateRight) {
|
33 |
+
const startOfISOWeekLeft = (0, _index2.startOfISOWeek)(dateLeft);
|
34 |
+
const startOfISOWeekRight = (0, _index2.startOfISOWeek)(dateRight);
|
35 |
+
|
36 |
+
const timestampLeft =
|
37 |
+
+startOfISOWeekLeft -
|
38 |
+
(0, _index3.getTimezoneOffsetInMilliseconds)(startOfISOWeekLeft);
|
39 |
+
const timestampRight =
|
40 |
+
+startOfISOWeekRight -
|
41 |
+
(0, _index3.getTimezoneOffsetInMilliseconds)(startOfISOWeekRight);
|
42 |
+
|
43 |
+
// Round the number of weeks to the nearest integer because the number of
|
44 |
+
// milliseconds in a week is not constant (e.g. it's different in the week of
|
45 |
+
// the daylight saving time clock shift).
|
46 |
+
return Math.round(
|
47 |
+
(timestampLeft - timestampRight) / _index.millisecondsInWeek,
|
48 |
+
);
|
49 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarISOWeeks.mjs
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { millisecondsInWeek } from "./constants.mjs";
|
2 |
+
import { startOfISOWeek } from "./startOfISOWeek.mjs";
|
3 |
+
import { getTimezoneOffsetInMilliseconds } from "./_lib/getTimezoneOffsetInMilliseconds.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name differenceInCalendarISOWeeks
|
7 |
+
* @category ISO Week Helpers
|
8 |
+
* @summary Get the number of calendar ISO weeks between the given dates.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the number of calendar ISO weeks between the given dates.
|
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 dateLeft - The later date
|
18 |
+
* @param dateRight - The earlier date
|
19 |
+
*
|
20 |
+
* @returns The number of calendar ISO weeks
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?
|
24 |
+
* const result = differenceInCalendarISOWeeks(
|
25 |
+
* new Date(2014, 6, 21),
|
26 |
+
* new Date(2014, 6, 6)
|
27 |
+
* )
|
28 |
+
* //=> 3
|
29 |
+
*/
|
30 |
+
export function differenceInCalendarISOWeeks(dateLeft, dateRight) {
|
31 |
+
const startOfISOWeekLeft = startOfISOWeek(dateLeft);
|
32 |
+
const startOfISOWeekRight = startOfISOWeek(dateRight);
|
33 |
+
|
34 |
+
const timestampLeft =
|
35 |
+
+startOfISOWeekLeft - getTimezoneOffsetInMilliseconds(startOfISOWeekLeft);
|
36 |
+
const timestampRight =
|
37 |
+
+startOfISOWeekRight - getTimezoneOffsetInMilliseconds(startOfISOWeekRight);
|
38 |
+
|
39 |
+
// Round the number of weeks to the nearest integer because the number of
|
40 |
+
// milliseconds in a week is not constant (e.g. it's different in the week of
|
41 |
+
// the daylight saving time clock shift).
|
42 |
+
return Math.round((timestampLeft - timestampRight) / millisecondsInWeek);
|
43 |
+
}
|
44 |
+
|
45 |
+
// Fallback for modularized imports:
|
46 |
+
export default differenceInCalendarISOWeeks;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarMonths.d.mts
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInCalendarMonths
|
3 |
+
* @category Month Helpers
|
4 |
+
* @summary Get the number of calendar months between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of calendar months between the given dates.
|
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 dateLeft - The later date
|
12 |
+
* @param dateRight - The earlier date
|
13 |
+
*
|
14 |
+
* @returns The number of calendar months
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // How many calendar months are between 31 January 2014 and 1 September 2014?
|
18 |
+
* const result = differenceInCalendarMonths(
|
19 |
+
* new Date(2014, 8, 1),
|
20 |
+
* new Date(2014, 0, 31)
|
21 |
+
* )
|
22 |
+
* //=> 8
|
23 |
+
*/
|
24 |
+
export declare function differenceInCalendarMonths<DateType extends Date>(
|
25 |
+
dateLeft: DateType | number | string,
|
26 |
+
dateRight: DateType | number | string,
|
27 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarMonths.d.ts
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInCalendarMonths
|
3 |
+
* @category Month Helpers
|
4 |
+
* @summary Get the number of calendar months between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of calendar months between the given dates.
|
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 dateLeft - The later date
|
12 |
+
* @param dateRight - The earlier date
|
13 |
+
*
|
14 |
+
* @returns The number of calendar months
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // How many calendar months are between 31 January 2014 and 1 September 2014?
|
18 |
+
* const result = differenceInCalendarMonths(
|
19 |
+
* new Date(2014, 8, 1),
|
20 |
+
* new Date(2014, 0, 31)
|
21 |
+
* )
|
22 |
+
* //=> 8
|
23 |
+
*/
|
24 |
+
export declare function differenceInCalendarMonths<DateType extends Date>(
|
25 |
+
dateLeft: DateType | number | string,
|
26 |
+
dateRight: DateType | number | string,
|
27 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarMonths.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInCalendarMonths = differenceInCalendarMonths;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name differenceInCalendarMonths
|
7 |
+
* @category Month Helpers
|
8 |
+
* @summary Get the number of calendar months between the given dates.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the number of calendar months between the given dates.
|
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 dateLeft - The later date
|
16 |
+
* @param dateRight - The earlier date
|
17 |
+
*
|
18 |
+
* @returns The number of calendar months
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // How many calendar months are between 31 January 2014 and 1 September 2014?
|
22 |
+
* const result = differenceInCalendarMonths(
|
23 |
+
* new Date(2014, 8, 1),
|
24 |
+
* new Date(2014, 0, 31)
|
25 |
+
* )
|
26 |
+
* //=> 8
|
27 |
+
*/
|
28 |
+
function differenceInCalendarMonths(dateLeft, dateRight) {
|
29 |
+
const _dateLeft = (0, _index.toDate)(dateLeft);
|
30 |
+
const _dateRight = (0, _index.toDate)(dateRight);
|
31 |
+
|
32 |
+
const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear();
|
33 |
+
const monthDiff = _dateLeft.getMonth() - _dateRight.getMonth();
|
34 |
+
|
35 |
+
return yearDiff * 12 + monthDiff;
|
36 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarMonths.mjs
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name differenceInCalendarMonths
|
5 |
+
* @category Month Helpers
|
6 |
+
* @summary Get the number of calendar months between the given dates.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Get the number of calendar months between the given dates.
|
10 |
+
*
|
11 |
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
12 |
+
*
|
13 |
+
* @param dateLeft - The later date
|
14 |
+
* @param dateRight - The earlier date
|
15 |
+
*
|
16 |
+
* @returns The number of calendar months
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // How many calendar months are between 31 January 2014 and 1 September 2014?
|
20 |
+
* const result = differenceInCalendarMonths(
|
21 |
+
* new Date(2014, 8, 1),
|
22 |
+
* new Date(2014, 0, 31)
|
23 |
+
* )
|
24 |
+
* //=> 8
|
25 |
+
*/
|
26 |
+
export function differenceInCalendarMonths(dateLeft, dateRight) {
|
27 |
+
const _dateLeft = toDate(dateLeft);
|
28 |
+
const _dateRight = toDate(dateRight);
|
29 |
+
|
30 |
+
const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear();
|
31 |
+
const monthDiff = _dateLeft.getMonth() - _dateRight.getMonth();
|
32 |
+
|
33 |
+
return yearDiff * 12 + monthDiff;
|
34 |
+
}
|
35 |
+
|
36 |
+
// Fallback for modularized imports:
|
37 |
+
export default differenceInCalendarMonths;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarQuarters.d.mts
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInCalendarQuarters
|
3 |
+
* @category Quarter Helpers
|
4 |
+
* @summary Get the number of calendar quarters between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of calendar quarters between the given dates.
|
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 dateLeft - The later date
|
12 |
+
* @param dateRight - The earlier date
|
13 |
+
|
14 |
+
* @returns The number of calendar quarters
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // How many calendar quarters are between 31 December 2013 and 2 July 2014?
|
18 |
+
* const result = differenceInCalendarQuarters(
|
19 |
+
* new Date(2014, 6, 2),
|
20 |
+
* new Date(2013, 11, 31)
|
21 |
+
* )
|
22 |
+
* //=> 3
|
23 |
+
*/
|
24 |
+
export declare function differenceInCalendarQuarters<DateType extends Date>(
|
25 |
+
dateLeft: DateType | number | string,
|
26 |
+
dateRight: DateType | number | string,
|
27 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarQuarters.d.ts
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInCalendarQuarters
|
3 |
+
* @category Quarter Helpers
|
4 |
+
* @summary Get the number of calendar quarters between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of calendar quarters between the given dates.
|
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 dateLeft - The later date
|
12 |
+
* @param dateRight - The earlier date
|
13 |
+
|
14 |
+
* @returns The number of calendar quarters
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // How many calendar quarters are between 31 December 2013 and 2 July 2014?
|
18 |
+
* const result = differenceInCalendarQuarters(
|
19 |
+
* new Date(2014, 6, 2),
|
20 |
+
* new Date(2013, 11, 31)
|
21 |
+
* )
|
22 |
+
* //=> 3
|
23 |
+
*/
|
24 |
+
export declare function differenceInCalendarQuarters<DateType extends Date>(
|
25 |
+
dateLeft: DateType | number | string,
|
26 |
+
dateRight: DateType | number | string,
|
27 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarQuarters.js
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInCalendarQuarters = differenceInCalendarQuarters;
|
3 |
+
var _index = require("./getQuarter.js");
|
4 |
+
var _index2 = require("./toDate.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name differenceInCalendarQuarters
|
8 |
+
* @category Quarter Helpers
|
9 |
+
* @summary Get the number of calendar quarters between the given dates.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the number of calendar quarters between the given dates.
|
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 dateLeft - The later date
|
17 |
+
* @param dateRight - The earlier date
|
18 |
+
|
19 |
+
* @returns The number of calendar quarters
|
20 |
+
*
|
21 |
+
* @example
|
22 |
+
* // How many calendar quarters are between 31 December 2013 and 2 July 2014?
|
23 |
+
* const result = differenceInCalendarQuarters(
|
24 |
+
* new Date(2014, 6, 2),
|
25 |
+
* new Date(2013, 11, 31)
|
26 |
+
* )
|
27 |
+
* //=> 3
|
28 |
+
*/
|
29 |
+
function differenceInCalendarQuarters(dateLeft, dateRight) {
|
30 |
+
const _dateLeft = (0, _index2.toDate)(dateLeft);
|
31 |
+
const _dateRight = (0, _index2.toDate)(dateRight);
|
32 |
+
|
33 |
+
const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear();
|
34 |
+
const quarterDiff =
|
35 |
+
(0, _index.getQuarter)(_dateLeft) - (0, _index.getQuarter)(_dateRight);
|
36 |
+
|
37 |
+
return yearDiff * 4 + quarterDiff;
|
38 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarQuarters.mjs
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getQuarter } from "./getQuarter.mjs";
|
2 |
+
import { toDate } from "./toDate.mjs";
|
3 |
+
|
4 |
+
/**
|
5 |
+
* @name differenceInCalendarQuarters
|
6 |
+
* @category Quarter Helpers
|
7 |
+
* @summary Get the number of calendar quarters between the given dates.
|
8 |
+
*
|
9 |
+
* @description
|
10 |
+
* Get the number of calendar quarters between the given dates.
|
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 dateLeft - The later date
|
15 |
+
* @param dateRight - The earlier date
|
16 |
+
|
17 |
+
* @returns The number of calendar quarters
|
18 |
+
*
|
19 |
+
* @example
|
20 |
+
* // How many calendar quarters are between 31 December 2013 and 2 July 2014?
|
21 |
+
* const result = differenceInCalendarQuarters(
|
22 |
+
* new Date(2014, 6, 2),
|
23 |
+
* new Date(2013, 11, 31)
|
24 |
+
* )
|
25 |
+
* //=> 3
|
26 |
+
*/
|
27 |
+
export function differenceInCalendarQuarters(dateLeft, dateRight) {
|
28 |
+
const _dateLeft = toDate(dateLeft);
|
29 |
+
const _dateRight = toDate(dateRight);
|
30 |
+
|
31 |
+
const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear();
|
32 |
+
const quarterDiff = getQuarter(_dateLeft) - getQuarter(_dateRight);
|
33 |
+
|
34 |
+
return yearDiff * 4 + quarterDiff;
|
35 |
+
}
|
36 |
+
|
37 |
+
// Fallback for modularized imports:
|
38 |
+
export default differenceInCalendarQuarters;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarWeeks.d.mts
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { LocalizedOptions, WeekOptions } from "./types.js";
|
2 |
+
/**
|
3 |
+
* The {@link differenceInCalendarWeeks} function options.
|
4 |
+
*/
|
5 |
+
export interface DifferenceInCalendarWeeksOptions
|
6 |
+
extends LocalizedOptions<"options">,
|
7 |
+
WeekOptions {}
|
8 |
+
/**
|
9 |
+
* @name differenceInCalendarWeeks
|
10 |
+
* @category Week Helpers
|
11 |
+
* @summary Get the number of calendar weeks between the given dates.
|
12 |
+
*
|
13 |
+
* @description
|
14 |
+
* Get the number of calendar weeks between the given dates.
|
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 dateLeft - The later date
|
19 |
+
* @param dateRight - The earlier date
|
20 |
+
* @param options - An object with options.
|
21 |
+
*
|
22 |
+
* @returns The number of calendar weeks
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // How many calendar weeks are between 5 July 2014 and 20 July 2014?
|
26 |
+
* const result = differenceInCalendarWeeks(
|
27 |
+
* new Date(2014, 6, 20),
|
28 |
+
* new Date(2014, 6, 5)
|
29 |
+
* )
|
30 |
+
* //=> 3
|
31 |
+
*
|
32 |
+
* @example
|
33 |
+
* // If the week starts on Monday,
|
34 |
+
* // how many calendar weeks are between 5 July 2014 and 20 July 2014?
|
35 |
+
* const result = differenceInCalendarWeeks(
|
36 |
+
* new Date(2014, 6, 20),
|
37 |
+
* new Date(2014, 6, 5),
|
38 |
+
* { weekStartsOn: 1 }
|
39 |
+
* )
|
40 |
+
* //=> 2
|
41 |
+
*/
|
42 |
+
export declare function differenceInCalendarWeeks<DateType extends Date>(
|
43 |
+
dateLeft: DateType | number | string,
|
44 |
+
dateRight: DateType | number | string,
|
45 |
+
options?: DifferenceInCalendarWeeksOptions,
|
46 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarWeeks.d.ts
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { LocalizedOptions, WeekOptions } from "./types.js";
|
2 |
+
/**
|
3 |
+
* The {@link differenceInCalendarWeeks} function options.
|
4 |
+
*/
|
5 |
+
export interface DifferenceInCalendarWeeksOptions
|
6 |
+
extends LocalizedOptions<"options">,
|
7 |
+
WeekOptions {}
|
8 |
+
/**
|
9 |
+
* @name differenceInCalendarWeeks
|
10 |
+
* @category Week Helpers
|
11 |
+
* @summary Get the number of calendar weeks between the given dates.
|
12 |
+
*
|
13 |
+
* @description
|
14 |
+
* Get the number of calendar weeks between the given dates.
|
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 dateLeft - The later date
|
19 |
+
* @param dateRight - The earlier date
|
20 |
+
* @param options - An object with options.
|
21 |
+
*
|
22 |
+
* @returns The number of calendar weeks
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // How many calendar weeks are between 5 July 2014 and 20 July 2014?
|
26 |
+
* const result = differenceInCalendarWeeks(
|
27 |
+
* new Date(2014, 6, 20),
|
28 |
+
* new Date(2014, 6, 5)
|
29 |
+
* )
|
30 |
+
* //=> 3
|
31 |
+
*
|
32 |
+
* @example
|
33 |
+
* // If the week starts on Monday,
|
34 |
+
* // how many calendar weeks are between 5 July 2014 and 20 July 2014?
|
35 |
+
* const result = differenceInCalendarWeeks(
|
36 |
+
* new Date(2014, 6, 20),
|
37 |
+
* new Date(2014, 6, 5),
|
38 |
+
* { weekStartsOn: 1 }
|
39 |
+
* )
|
40 |
+
* //=> 2
|
41 |
+
*/
|
42 |
+
export declare function differenceInCalendarWeeks<DateType extends Date>(
|
43 |
+
dateLeft: DateType | number | string,
|
44 |
+
dateRight: DateType | number | string,
|
45 |
+
options?: DifferenceInCalendarWeeksOptions,
|
46 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarWeeks.js
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInCalendarWeeks = differenceInCalendarWeeks;
|
3 |
+
var _index = require("./constants.js");
|
4 |
+
var _index2 = require("./startOfWeek.js");
|
5 |
+
|
6 |
+
var _index3 = require("./_lib/getTimezoneOffsetInMilliseconds.js");
|
7 |
+
|
8 |
+
/**
|
9 |
+
* The {@link differenceInCalendarWeeks} function options.
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @name differenceInCalendarWeeks
|
14 |
+
* @category Week Helpers
|
15 |
+
* @summary Get the number of calendar weeks between the given dates.
|
16 |
+
*
|
17 |
+
* @description
|
18 |
+
* Get the number of calendar weeks between the given dates.
|
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 dateLeft - The later date
|
23 |
+
* @param dateRight - The earlier date
|
24 |
+
* @param options - An object with options.
|
25 |
+
*
|
26 |
+
* @returns The number of calendar weeks
|
27 |
+
*
|
28 |
+
* @example
|
29 |
+
* // How many calendar weeks are between 5 July 2014 and 20 July 2014?
|
30 |
+
* const result = differenceInCalendarWeeks(
|
31 |
+
* new Date(2014, 6, 20),
|
32 |
+
* new Date(2014, 6, 5)
|
33 |
+
* )
|
34 |
+
* //=> 3
|
35 |
+
*
|
36 |
+
* @example
|
37 |
+
* // If the week starts on Monday,
|
38 |
+
* // how many calendar weeks are between 5 July 2014 and 20 July 2014?
|
39 |
+
* const result = differenceInCalendarWeeks(
|
40 |
+
* new Date(2014, 6, 20),
|
41 |
+
* new Date(2014, 6, 5),
|
42 |
+
* { weekStartsOn: 1 }
|
43 |
+
* )
|
44 |
+
* //=> 2
|
45 |
+
*/
|
46 |
+
function differenceInCalendarWeeks(dateLeft, dateRight, options) {
|
47 |
+
const startOfWeekLeft = (0, _index2.startOfWeek)(dateLeft, options);
|
48 |
+
const startOfWeekRight = (0, _index2.startOfWeek)(dateRight, options);
|
49 |
+
|
50 |
+
const timestampLeft =
|
51 |
+
+startOfWeekLeft -
|
52 |
+
(0, _index3.getTimezoneOffsetInMilliseconds)(startOfWeekLeft);
|
53 |
+
const timestampRight =
|
54 |
+
+startOfWeekRight -
|
55 |
+
(0, _index3.getTimezoneOffsetInMilliseconds)(startOfWeekRight);
|
56 |
+
|
57 |
+
// Round the number of days to the nearest integer because the number of
|
58 |
+
// milliseconds in a days is not constant (e.g. it's different in the week of
|
59 |
+
// the daylight saving time clock shift).
|
60 |
+
return Math.round(
|
61 |
+
(timestampLeft - timestampRight) / _index.millisecondsInWeek,
|
62 |
+
);
|
63 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarWeeks.mjs
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { millisecondsInWeek } from "./constants.mjs";
|
2 |
+
import { startOfWeek } from "./startOfWeek.mjs";
|
3 |
+
import { getTimezoneOffsetInMilliseconds } from "./_lib/getTimezoneOffsetInMilliseconds.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* The {@link differenceInCalendarWeeks} function options.
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @name differenceInCalendarWeeks
|
11 |
+
* @category Week Helpers
|
12 |
+
* @summary Get the number of calendar weeks between the given dates.
|
13 |
+
*
|
14 |
+
* @description
|
15 |
+
* Get the number of calendar weeks between the given dates.
|
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 dateLeft - The later date
|
20 |
+
* @param dateRight - The earlier date
|
21 |
+
* @param options - An object with options.
|
22 |
+
*
|
23 |
+
* @returns The number of calendar weeks
|
24 |
+
*
|
25 |
+
* @example
|
26 |
+
* // How many calendar weeks are between 5 July 2014 and 20 July 2014?
|
27 |
+
* const result = differenceInCalendarWeeks(
|
28 |
+
* new Date(2014, 6, 20),
|
29 |
+
* new Date(2014, 6, 5)
|
30 |
+
* )
|
31 |
+
* //=> 3
|
32 |
+
*
|
33 |
+
* @example
|
34 |
+
* // If the week starts on Monday,
|
35 |
+
* // how many calendar weeks are between 5 July 2014 and 20 July 2014?
|
36 |
+
* const result = differenceInCalendarWeeks(
|
37 |
+
* new Date(2014, 6, 20),
|
38 |
+
* new Date(2014, 6, 5),
|
39 |
+
* { weekStartsOn: 1 }
|
40 |
+
* )
|
41 |
+
* //=> 2
|
42 |
+
*/
|
43 |
+
export function differenceInCalendarWeeks(dateLeft, dateRight, options) {
|
44 |
+
const startOfWeekLeft = startOfWeek(dateLeft, options);
|
45 |
+
const startOfWeekRight = startOfWeek(dateRight, options);
|
46 |
+
|
47 |
+
const timestampLeft =
|
48 |
+
+startOfWeekLeft - getTimezoneOffsetInMilliseconds(startOfWeekLeft);
|
49 |
+
const timestampRight =
|
50 |
+
+startOfWeekRight - getTimezoneOffsetInMilliseconds(startOfWeekRight);
|
51 |
+
|
52 |
+
// Round the number of days to the nearest integer because the number of
|
53 |
+
// milliseconds in a days is not constant (e.g. it's different in the week of
|
54 |
+
// the daylight saving time clock shift).
|
55 |
+
return Math.round((timestampLeft - timestampRight) / millisecondsInWeek);
|
56 |
+
}
|
57 |
+
|
58 |
+
// Fallback for modularized imports:
|
59 |
+
export default differenceInCalendarWeeks;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarYears.d.mts
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInCalendarYears
|
3 |
+
* @category Year Helpers
|
4 |
+
* @summary Get the number of calendar years between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of calendar years between the given dates.
|
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 dateLeft - The later date
|
12 |
+
* @param dateRight - The earlier date
|
13 |
+
|
14 |
+
* @returns The number of calendar years
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // How many calendar years are between 31 December 2013 and 11 February 2015?
|
18 |
+
* const result = differenceInCalendarYears(
|
19 |
+
* new Date(2015, 1, 11),
|
20 |
+
* new Date(2013, 11, 31)
|
21 |
+
* )
|
22 |
+
* //=> 2
|
23 |
+
*/
|
24 |
+
export declare function differenceInCalendarYears<DateType extends Date>(
|
25 |
+
dateLeft: DateType | number | string,
|
26 |
+
dateRight: DateType | number | string,
|
27 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarYears.d.ts
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInCalendarYears
|
3 |
+
* @category Year Helpers
|
4 |
+
* @summary Get the number of calendar years between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of calendar years between the given dates.
|
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 dateLeft - The later date
|
12 |
+
* @param dateRight - The earlier date
|
13 |
+
|
14 |
+
* @returns The number of calendar years
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // How many calendar years are between 31 December 2013 and 11 February 2015?
|
18 |
+
* const result = differenceInCalendarYears(
|
19 |
+
* new Date(2015, 1, 11),
|
20 |
+
* new Date(2013, 11, 31)
|
21 |
+
* )
|
22 |
+
* //=> 2
|
23 |
+
*/
|
24 |
+
export declare function differenceInCalendarYears<DateType extends Date>(
|
25 |
+
dateLeft: DateType | number | string,
|
26 |
+
dateRight: DateType | number | string,
|
27 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarYears.js
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInCalendarYears = differenceInCalendarYears;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name differenceInCalendarYears
|
7 |
+
* @category Year Helpers
|
8 |
+
* @summary Get the number of calendar years between the given dates.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the number of calendar years between the given dates.
|
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 dateLeft - The later date
|
16 |
+
* @param dateRight - The earlier date
|
17 |
+
|
18 |
+
* @returns The number of calendar years
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // How many calendar years are between 31 December 2013 and 11 February 2015?
|
22 |
+
* const result = differenceInCalendarYears(
|
23 |
+
* new Date(2015, 1, 11),
|
24 |
+
* new Date(2013, 11, 31)
|
25 |
+
* )
|
26 |
+
* //=> 2
|
27 |
+
*/
|
28 |
+
function differenceInCalendarYears(dateLeft, dateRight) {
|
29 |
+
const _dateLeft = (0, _index.toDate)(dateLeft);
|
30 |
+
const _dateRight = (0, _index.toDate)(dateRight);
|
31 |
+
|
32 |
+
return _dateLeft.getFullYear() - _dateRight.getFullYear();
|
33 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInCalendarYears.mjs
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name differenceInCalendarYears
|
5 |
+
* @category Year Helpers
|
6 |
+
* @summary Get the number of calendar years between the given dates.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Get the number of calendar years between the given dates.
|
10 |
+
*
|
11 |
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
12 |
+
*
|
13 |
+
* @param dateLeft - The later date
|
14 |
+
* @param dateRight - The earlier date
|
15 |
+
|
16 |
+
* @returns The number of calendar years
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // How many calendar years are between 31 December 2013 and 11 February 2015?
|
20 |
+
* const result = differenceInCalendarYears(
|
21 |
+
* new Date(2015, 1, 11),
|
22 |
+
* new Date(2013, 11, 31)
|
23 |
+
* )
|
24 |
+
* //=> 2
|
25 |
+
*/
|
26 |
+
export function differenceInCalendarYears(dateLeft, dateRight) {
|
27 |
+
const _dateLeft = toDate(dateLeft);
|
28 |
+
const _dateRight = toDate(dateRight);
|
29 |
+
|
30 |
+
return _dateLeft.getFullYear() - _dateRight.getFullYear();
|
31 |
+
}
|
32 |
+
|
33 |
+
// Fallback for modularized imports:
|
34 |
+
export default differenceInCalendarYears;
|
workers1/auto3d/node_modules/date-fns/differenceInDays.d.mts
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInDays
|
3 |
+
* @category Day Helpers
|
4 |
+
* @summary Get the number of full days between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of full day periods between two dates. Fractional days are
|
8 |
+
* truncated towards zero.
|
9 |
+
*
|
10 |
+
* One "full day" is the distance between a local time in one day to the same
|
11 |
+
* local time on the next or previous day. A full day can sometimes be less than
|
12 |
+
* or more than 24 hours if a daylight savings change happens between two dates.
|
13 |
+
*
|
14 |
+
* To ignore DST and only measure exact 24-hour periods, use this instead:
|
15 |
+
* `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.
|
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 dateLeft - The later date
|
20 |
+
* @param dateRight - The earlier date
|
21 |
+
*
|
22 |
+
* @returns The number of full days according to the local timezone
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // How many full days are between
|
26 |
+
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
|
27 |
+
* const result = differenceInDays(
|
28 |
+
* new Date(2012, 6, 2, 0, 0),
|
29 |
+
* new Date(2011, 6, 2, 23, 0)
|
30 |
+
* )
|
31 |
+
* //=> 365
|
32 |
+
*
|
33 |
+
* @example
|
34 |
+
* // How many full days are between
|
35 |
+
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
|
36 |
+
* const result = differenceInDays(
|
37 |
+
* new Date(2011, 6, 3, 0, 1),
|
38 |
+
* new Date(2011, 6, 2, 23, 59)
|
39 |
+
* )
|
40 |
+
* //=> 0
|
41 |
+
*
|
42 |
+
* @example
|
43 |
+
* // How many full days are between
|
44 |
+
* // 1 March 2020 0:00 and 1 June 2020 0:00 ?
|
45 |
+
* // Note: because local time is used, the
|
46 |
+
* // result will always be 92 days, even in
|
47 |
+
* // time zones where DST starts and the
|
48 |
+
* // period has only 92*24-1 hours.
|
49 |
+
* const result = differenceInDays(
|
50 |
+
* new Date(2020, 5, 1),
|
51 |
+
* new Date(2020, 2, 1)
|
52 |
+
* )
|
53 |
+
* //=> 92
|
54 |
+
*/
|
55 |
+
export declare function differenceInDays<DateType extends Date>(
|
56 |
+
dateLeft: DateType | number | string,
|
57 |
+
dateRight: DateType | number | string,
|
58 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInDays.d.ts
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInDays
|
3 |
+
* @category Day Helpers
|
4 |
+
* @summary Get the number of full days between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of full day periods between two dates. Fractional days are
|
8 |
+
* truncated towards zero.
|
9 |
+
*
|
10 |
+
* One "full day" is the distance between a local time in one day to the same
|
11 |
+
* local time on the next or previous day. A full day can sometimes be less than
|
12 |
+
* or more than 24 hours if a daylight savings change happens between two dates.
|
13 |
+
*
|
14 |
+
* To ignore DST and only measure exact 24-hour periods, use this instead:
|
15 |
+
* `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.
|
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 dateLeft - The later date
|
20 |
+
* @param dateRight - The earlier date
|
21 |
+
*
|
22 |
+
* @returns The number of full days according to the local timezone
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // How many full days are between
|
26 |
+
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
|
27 |
+
* const result = differenceInDays(
|
28 |
+
* new Date(2012, 6, 2, 0, 0),
|
29 |
+
* new Date(2011, 6, 2, 23, 0)
|
30 |
+
* )
|
31 |
+
* //=> 365
|
32 |
+
*
|
33 |
+
* @example
|
34 |
+
* // How many full days are between
|
35 |
+
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
|
36 |
+
* const result = differenceInDays(
|
37 |
+
* new Date(2011, 6, 3, 0, 1),
|
38 |
+
* new Date(2011, 6, 2, 23, 59)
|
39 |
+
* )
|
40 |
+
* //=> 0
|
41 |
+
*
|
42 |
+
* @example
|
43 |
+
* // How many full days are between
|
44 |
+
* // 1 March 2020 0:00 and 1 June 2020 0:00 ?
|
45 |
+
* // Note: because local time is used, the
|
46 |
+
* // result will always be 92 days, even in
|
47 |
+
* // time zones where DST starts and the
|
48 |
+
* // period has only 92*24-1 hours.
|
49 |
+
* const result = differenceInDays(
|
50 |
+
* new Date(2020, 5, 1),
|
51 |
+
* new Date(2020, 2, 1)
|
52 |
+
* )
|
53 |
+
* //=> 92
|
54 |
+
*/
|
55 |
+
export declare function differenceInDays<DateType extends Date>(
|
56 |
+
dateLeft: DateType | number | string,
|
57 |
+
dateRight: DateType | number | string,
|
58 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInDays.js
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInDays = differenceInDays;
|
3 |
+
var _index = require("./differenceInCalendarDays.js");
|
4 |
+
var _index2 = require("./toDate.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name differenceInDays
|
8 |
+
* @category Day Helpers
|
9 |
+
* @summary Get the number of full days between the given dates.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the number of full day periods between two dates. Fractional days are
|
13 |
+
* truncated towards zero.
|
14 |
+
*
|
15 |
+
* One "full day" is the distance between a local time in one day to the same
|
16 |
+
* local time on the next or previous day. A full day can sometimes be less than
|
17 |
+
* or more than 24 hours if a daylight savings change happens between two dates.
|
18 |
+
*
|
19 |
+
* To ignore DST and only measure exact 24-hour periods, use this instead:
|
20 |
+
* `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.
|
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 dateLeft - The later date
|
25 |
+
* @param dateRight - The earlier date
|
26 |
+
*
|
27 |
+
* @returns The number of full days according to the local timezone
|
28 |
+
*
|
29 |
+
* @example
|
30 |
+
* // How many full days are between
|
31 |
+
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
|
32 |
+
* const result = differenceInDays(
|
33 |
+
* new Date(2012, 6, 2, 0, 0),
|
34 |
+
* new Date(2011, 6, 2, 23, 0)
|
35 |
+
* )
|
36 |
+
* //=> 365
|
37 |
+
*
|
38 |
+
* @example
|
39 |
+
* // How many full days are between
|
40 |
+
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
|
41 |
+
* const result = differenceInDays(
|
42 |
+
* new Date(2011, 6, 3, 0, 1),
|
43 |
+
* new Date(2011, 6, 2, 23, 59)
|
44 |
+
* )
|
45 |
+
* //=> 0
|
46 |
+
*
|
47 |
+
* @example
|
48 |
+
* // How many full days are between
|
49 |
+
* // 1 March 2020 0:00 and 1 June 2020 0:00 ?
|
50 |
+
* // Note: because local time is used, the
|
51 |
+
* // result will always be 92 days, even in
|
52 |
+
* // time zones where DST starts and the
|
53 |
+
* // period has only 92*24-1 hours.
|
54 |
+
* const result = differenceInDays(
|
55 |
+
* new Date(2020, 5, 1),
|
56 |
+
* new Date(2020, 2, 1)
|
57 |
+
* )
|
58 |
+
* //=> 92
|
59 |
+
*/
|
60 |
+
function differenceInDays(dateLeft, dateRight) {
|
61 |
+
const _dateLeft = (0, _index2.toDate)(dateLeft);
|
62 |
+
const _dateRight = (0, _index2.toDate)(dateRight);
|
63 |
+
|
64 |
+
const sign = compareLocalAsc(_dateLeft, _dateRight);
|
65 |
+
const difference = Math.abs(
|
66 |
+
(0, _index.differenceInCalendarDays)(_dateLeft, _dateRight),
|
67 |
+
);
|
68 |
+
|
69 |
+
_dateLeft.setDate(_dateLeft.getDate() - sign * difference);
|
70 |
+
|
71 |
+
// Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full
|
72 |
+
// If so, result must be decreased by 1 in absolute value
|
73 |
+
const isLastDayNotFull = Number(
|
74 |
+
compareLocalAsc(_dateLeft, _dateRight) === -sign,
|
75 |
+
);
|
76 |
+
const result = sign * (difference - isLastDayNotFull);
|
77 |
+
// Prevent negative zero
|
78 |
+
return result === 0 ? 0 : result;
|
79 |
+
}
|
80 |
+
|
81 |
+
// Like `compareAsc` but uses local time not UTC, which is needed
|
82 |
+
// for accurate equality comparisons of UTC timestamps that end up
|
83 |
+
// having the same representation in local time, e.g. one hour before
|
84 |
+
// DST ends vs. the instant that DST ends.
|
85 |
+
function compareLocalAsc(dateLeft, dateRight) {
|
86 |
+
const diff =
|
87 |
+
dateLeft.getFullYear() - dateRight.getFullYear() ||
|
88 |
+
dateLeft.getMonth() - dateRight.getMonth() ||
|
89 |
+
dateLeft.getDate() - dateRight.getDate() ||
|
90 |
+
dateLeft.getHours() - dateRight.getHours() ||
|
91 |
+
dateLeft.getMinutes() - dateRight.getMinutes() ||
|
92 |
+
dateLeft.getSeconds() - dateRight.getSeconds() ||
|
93 |
+
dateLeft.getMilliseconds() - dateRight.getMilliseconds();
|
94 |
+
|
95 |
+
if (diff < 0) {
|
96 |
+
return -1;
|
97 |
+
} else if (diff > 0) {
|
98 |
+
return 1;
|
99 |
+
// Return 0 if diff is 0; return NaN if diff is NaN
|
100 |
+
} else {
|
101 |
+
return diff;
|
102 |
+
}
|
103 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInDays.mjs
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { differenceInCalendarDays } from "./differenceInCalendarDays.mjs";
|
2 |
+
import { toDate } from "./toDate.mjs";
|
3 |
+
|
4 |
+
/**
|
5 |
+
* @name differenceInDays
|
6 |
+
* @category Day Helpers
|
7 |
+
* @summary Get the number of full days between the given dates.
|
8 |
+
*
|
9 |
+
* @description
|
10 |
+
* Get the number of full day periods between two dates. Fractional days are
|
11 |
+
* truncated towards zero.
|
12 |
+
*
|
13 |
+
* One "full day" is the distance between a local time in one day to the same
|
14 |
+
* local time on the next or previous day. A full day can sometimes be less than
|
15 |
+
* or more than 24 hours if a daylight savings change happens between two dates.
|
16 |
+
*
|
17 |
+
* To ignore DST and only measure exact 24-hour periods, use this instead:
|
18 |
+
* `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.
|
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 dateLeft - The later date
|
23 |
+
* @param dateRight - The earlier date
|
24 |
+
*
|
25 |
+
* @returns The number of full days according to the local timezone
|
26 |
+
*
|
27 |
+
* @example
|
28 |
+
* // How many full days are between
|
29 |
+
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
|
30 |
+
* const result = differenceInDays(
|
31 |
+
* new Date(2012, 6, 2, 0, 0),
|
32 |
+
* new Date(2011, 6, 2, 23, 0)
|
33 |
+
* )
|
34 |
+
* //=> 365
|
35 |
+
*
|
36 |
+
* @example
|
37 |
+
* // How many full days are between
|
38 |
+
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
|
39 |
+
* const result = differenceInDays(
|
40 |
+
* new Date(2011, 6, 3, 0, 1),
|
41 |
+
* new Date(2011, 6, 2, 23, 59)
|
42 |
+
* )
|
43 |
+
* //=> 0
|
44 |
+
*
|
45 |
+
* @example
|
46 |
+
* // How many full days are between
|
47 |
+
* // 1 March 2020 0:00 and 1 June 2020 0:00 ?
|
48 |
+
* // Note: because local time is used, the
|
49 |
+
* // result will always be 92 days, even in
|
50 |
+
* // time zones where DST starts and the
|
51 |
+
* // period has only 92*24-1 hours.
|
52 |
+
* const result = differenceInDays(
|
53 |
+
* new Date(2020, 5, 1),
|
54 |
+
* new Date(2020, 2, 1)
|
55 |
+
* )
|
56 |
+
* //=> 92
|
57 |
+
*/
|
58 |
+
export function differenceInDays(dateLeft, dateRight) {
|
59 |
+
const _dateLeft = toDate(dateLeft);
|
60 |
+
const _dateRight = toDate(dateRight);
|
61 |
+
|
62 |
+
const sign = compareLocalAsc(_dateLeft, _dateRight);
|
63 |
+
const difference = Math.abs(differenceInCalendarDays(_dateLeft, _dateRight));
|
64 |
+
|
65 |
+
_dateLeft.setDate(_dateLeft.getDate() - sign * difference);
|
66 |
+
|
67 |
+
// Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full
|
68 |
+
// If so, result must be decreased by 1 in absolute value
|
69 |
+
const isLastDayNotFull = Number(
|
70 |
+
compareLocalAsc(_dateLeft, _dateRight) === -sign,
|
71 |
+
);
|
72 |
+
const result = sign * (difference - isLastDayNotFull);
|
73 |
+
// Prevent negative zero
|
74 |
+
return result === 0 ? 0 : result;
|
75 |
+
}
|
76 |
+
|
77 |
+
// Like `compareAsc` but uses local time not UTC, which is needed
|
78 |
+
// for accurate equality comparisons of UTC timestamps that end up
|
79 |
+
// having the same representation in local time, e.g. one hour before
|
80 |
+
// DST ends vs. the instant that DST ends.
|
81 |
+
function compareLocalAsc(dateLeft, dateRight) {
|
82 |
+
const diff =
|
83 |
+
dateLeft.getFullYear() - dateRight.getFullYear() ||
|
84 |
+
dateLeft.getMonth() - dateRight.getMonth() ||
|
85 |
+
dateLeft.getDate() - dateRight.getDate() ||
|
86 |
+
dateLeft.getHours() - dateRight.getHours() ||
|
87 |
+
dateLeft.getMinutes() - dateRight.getMinutes() ||
|
88 |
+
dateLeft.getSeconds() - dateRight.getSeconds() ||
|
89 |
+
dateLeft.getMilliseconds() - dateRight.getMilliseconds();
|
90 |
+
|
91 |
+
if (diff < 0) {
|
92 |
+
return -1;
|
93 |
+
} else if (diff > 0) {
|
94 |
+
return 1;
|
95 |
+
// Return 0 if diff is 0; return NaN if diff is NaN
|
96 |
+
} else {
|
97 |
+
return diff;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
// Fallback for modularized imports:
|
102 |
+
export default differenceInDays;
|
workers1/auto3d/node_modules/date-fns/differenceInHours.d.mts
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { RoundingOptions } from "./types.js";
|
2 |
+
/**
|
3 |
+
* The {@link differenceInHours} function options.
|
4 |
+
*/
|
5 |
+
export interface DifferenceInHoursOptions extends RoundingOptions {}
|
6 |
+
/**
|
7 |
+
* @name differenceInHours
|
8 |
+
* @category Hour Helpers
|
9 |
+
* @summary Get the number of hours between the given dates.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the number of hours between the given dates.
|
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 dateLeft - The later date
|
17 |
+
* @param dateRight - The earlier date
|
18 |
+
* @param options - An object with options.
|
19 |
+
*
|
20 |
+
* @returns The number of hours
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?
|
24 |
+
* const result = differenceInHours(
|
25 |
+
* new Date(2014, 6, 2, 19, 0),
|
26 |
+
* new Date(2014, 6, 2, 6, 50)
|
27 |
+
* )
|
28 |
+
* //=> 12
|
29 |
+
*/
|
30 |
+
export declare function differenceInHours<DateType extends Date>(
|
31 |
+
dateLeft: DateType | number | string,
|
32 |
+
dateRight: DateType | number | string,
|
33 |
+
options?: DifferenceInHoursOptions,
|
34 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInHours.d.ts
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { RoundingOptions } from "./types.js";
|
2 |
+
/**
|
3 |
+
* The {@link differenceInHours} function options.
|
4 |
+
*/
|
5 |
+
export interface DifferenceInHoursOptions extends RoundingOptions {}
|
6 |
+
/**
|
7 |
+
* @name differenceInHours
|
8 |
+
* @category Hour Helpers
|
9 |
+
* @summary Get the number of hours between the given dates.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the number of hours between the given dates.
|
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 dateLeft - The later date
|
17 |
+
* @param dateRight - The earlier date
|
18 |
+
* @param options - An object with options.
|
19 |
+
*
|
20 |
+
* @returns The number of hours
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?
|
24 |
+
* const result = differenceInHours(
|
25 |
+
* new Date(2014, 6, 2, 19, 0),
|
26 |
+
* new Date(2014, 6, 2, 6, 50)
|
27 |
+
* )
|
28 |
+
* //=> 12
|
29 |
+
*/
|
30 |
+
export declare function differenceInHours<DateType extends Date>(
|
31 |
+
dateLeft: DateType | number | string,
|
32 |
+
dateRight: DateType | number | string,
|
33 |
+
options?: DifferenceInHoursOptions,
|
34 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInHours.js
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInHours = differenceInHours;
|
3 |
+
var _index = require("./_lib/getRoundingMethod.js");
|
4 |
+
var _index2 = require("./constants.js");
|
5 |
+
var _index3 = require("./differenceInMilliseconds.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The {@link differenceInHours} function options.
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @name differenceInHours
|
13 |
+
* @category Hour Helpers
|
14 |
+
* @summary Get the number of hours between the given dates.
|
15 |
+
*
|
16 |
+
* @description
|
17 |
+
* Get the number of hours between the given dates.
|
18 |
+
*
|
19 |
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
20 |
+
*
|
21 |
+
* @param dateLeft - The later date
|
22 |
+
* @param dateRight - The earlier date
|
23 |
+
* @param options - An object with options.
|
24 |
+
*
|
25 |
+
* @returns The number of hours
|
26 |
+
*
|
27 |
+
* @example
|
28 |
+
* // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?
|
29 |
+
* const result = differenceInHours(
|
30 |
+
* new Date(2014, 6, 2, 19, 0),
|
31 |
+
* new Date(2014, 6, 2, 6, 50)
|
32 |
+
* )
|
33 |
+
* //=> 12
|
34 |
+
*/
|
35 |
+
function differenceInHours(dateLeft, dateRight, options) {
|
36 |
+
const diff =
|
37 |
+
(0, _index3.differenceInMilliseconds)(dateLeft, dateRight) /
|
38 |
+
_index2.millisecondsInHour;
|
39 |
+
return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff);
|
40 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInHours.mjs
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getRoundingMethod } from "./_lib/getRoundingMethod.mjs";
|
2 |
+
import { millisecondsInHour } from "./constants.mjs";
|
3 |
+
import { differenceInMilliseconds } from "./differenceInMilliseconds.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* The {@link differenceInHours} function options.
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @name differenceInHours
|
11 |
+
* @category Hour Helpers
|
12 |
+
* @summary Get the number of hours between the given dates.
|
13 |
+
*
|
14 |
+
* @description
|
15 |
+
* Get the number of hours between the given dates.
|
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 dateLeft - The later date
|
20 |
+
* @param dateRight - The earlier date
|
21 |
+
* @param options - An object with options.
|
22 |
+
*
|
23 |
+
* @returns The number of hours
|
24 |
+
*
|
25 |
+
* @example
|
26 |
+
* // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?
|
27 |
+
* const result = differenceInHours(
|
28 |
+
* new Date(2014, 6, 2, 19, 0),
|
29 |
+
* new Date(2014, 6, 2, 6, 50)
|
30 |
+
* )
|
31 |
+
* //=> 12
|
32 |
+
*/
|
33 |
+
export function differenceInHours(dateLeft, dateRight, options) {
|
34 |
+
const diff =
|
35 |
+
differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;
|
36 |
+
return getRoundingMethod(options?.roundingMethod)(diff);
|
37 |
+
}
|
38 |
+
|
39 |
+
// Fallback for modularized imports:
|
40 |
+
export default differenceInHours;
|
workers1/auto3d/node_modules/date-fns/differenceInISOWeekYears.d.mts
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInISOWeekYears
|
3 |
+
* @category ISO Week-Numbering Year Helpers
|
4 |
+
* @summary Get the number of full ISO week-numbering years between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of full ISO week-numbering years between the given dates.
|
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 dateLeft - The later date
|
14 |
+
* @param dateRight - The earlier date
|
15 |
+
*
|
16 |
+
* @returns The number of full ISO week-numbering years
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?
|
20 |
+
* const result = differenceInISOWeekYears(
|
21 |
+
* new Date(2012, 0, 1),
|
22 |
+
* new Date(2010, 0, 1)
|
23 |
+
* )
|
24 |
+
* //=> 1
|
25 |
+
*/
|
26 |
+
export declare function differenceInISOWeekYears<DateType extends Date>(
|
27 |
+
dateLeft: DateType | number | string,
|
28 |
+
dateRight: DateType | number | string,
|
29 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInISOWeekYears.d.ts
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInISOWeekYears
|
3 |
+
* @category ISO Week-Numbering Year Helpers
|
4 |
+
* @summary Get the number of full ISO week-numbering years between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of full ISO week-numbering years between the given dates.
|
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 dateLeft - The later date
|
14 |
+
* @param dateRight - The earlier date
|
15 |
+
*
|
16 |
+
* @returns The number of full ISO week-numbering years
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?
|
20 |
+
* const result = differenceInISOWeekYears(
|
21 |
+
* new Date(2012, 0, 1),
|
22 |
+
* new Date(2010, 0, 1)
|
23 |
+
* )
|
24 |
+
* //=> 1
|
25 |
+
*/
|
26 |
+
export declare function differenceInISOWeekYears<DateType extends Date>(
|
27 |
+
dateLeft: DateType | number | string,
|
28 |
+
dateRight: DateType | number | string,
|
29 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInISOWeekYears.js
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInISOWeekYears = differenceInISOWeekYears;
|
3 |
+
var _index = require("./compareAsc.js");
|
4 |
+
var _index2 = require("./differenceInCalendarISOWeekYears.js");
|
5 |
+
var _index3 = require("./subISOWeekYears.js");
|
6 |
+
var _index4 = require("./toDate.js");
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @name differenceInISOWeekYears
|
10 |
+
* @category ISO Week-Numbering Year Helpers
|
11 |
+
* @summary Get the number of full ISO week-numbering years between the given dates.
|
12 |
+
*
|
13 |
+
* @description
|
14 |
+
* Get the number of full ISO week-numbering years between the given dates.
|
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 dateLeft - The later date
|
21 |
+
* @param dateRight - The earlier date
|
22 |
+
*
|
23 |
+
* @returns The number of full ISO week-numbering years
|
24 |
+
*
|
25 |
+
* @example
|
26 |
+
* // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?
|
27 |
+
* const result = differenceInISOWeekYears(
|
28 |
+
* new Date(2012, 0, 1),
|
29 |
+
* new Date(2010, 0, 1)
|
30 |
+
* )
|
31 |
+
* //=> 1
|
32 |
+
*/
|
33 |
+
function differenceInISOWeekYears(dateLeft, dateRight) {
|
34 |
+
let _dateLeft = (0, _index4.toDate)(dateLeft);
|
35 |
+
const _dateRight = (0, _index4.toDate)(dateRight);
|
36 |
+
|
37 |
+
const sign = (0, _index.compareAsc)(_dateLeft, _dateRight);
|
38 |
+
const difference = Math.abs(
|
39 |
+
(0, _index2.differenceInCalendarISOWeekYears)(_dateLeft, _dateRight),
|
40 |
+
);
|
41 |
+
_dateLeft = (0, _index3.subISOWeekYears)(_dateLeft, sign * difference);
|
42 |
+
|
43 |
+
// Math.abs(diff in full ISO years - diff in calendar ISO years) === 1
|
44 |
+
// if last calendar ISO year is not full
|
45 |
+
// If so, result must be decreased by 1 in absolute value
|
46 |
+
const isLastISOWeekYearNotFull = Number(
|
47 |
+
(0, _index.compareAsc)(_dateLeft, _dateRight) === -sign,
|
48 |
+
);
|
49 |
+
const result = sign * (difference - isLastISOWeekYearNotFull);
|
50 |
+
// Prevent negative zero
|
51 |
+
return result === 0 ? 0 : result;
|
52 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInISOWeekYears.mjs
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { compareAsc } from "./compareAsc.mjs";
|
2 |
+
import { differenceInCalendarISOWeekYears } from "./differenceInCalendarISOWeekYears.mjs";
|
3 |
+
import { subISOWeekYears } from "./subISOWeekYears.mjs";
|
4 |
+
import { toDate } from "./toDate.mjs";
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name differenceInISOWeekYears
|
8 |
+
* @category ISO Week-Numbering Year Helpers
|
9 |
+
* @summary Get the number of full ISO week-numbering years between the given dates.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the number of full ISO week-numbering years between the given dates.
|
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 dateLeft - The later date
|
19 |
+
* @param dateRight - The earlier date
|
20 |
+
*
|
21 |
+
* @returns The number of full ISO week-numbering years
|
22 |
+
*
|
23 |
+
* @example
|
24 |
+
* // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?
|
25 |
+
* const result = differenceInISOWeekYears(
|
26 |
+
* new Date(2012, 0, 1),
|
27 |
+
* new Date(2010, 0, 1)
|
28 |
+
* )
|
29 |
+
* //=> 1
|
30 |
+
*/
|
31 |
+
export function differenceInISOWeekYears(dateLeft, dateRight) {
|
32 |
+
let _dateLeft = toDate(dateLeft);
|
33 |
+
const _dateRight = toDate(dateRight);
|
34 |
+
|
35 |
+
const sign = compareAsc(_dateLeft, _dateRight);
|
36 |
+
const difference = Math.abs(
|
37 |
+
differenceInCalendarISOWeekYears(_dateLeft, _dateRight),
|
38 |
+
);
|
39 |
+
_dateLeft = subISOWeekYears(_dateLeft, sign * difference);
|
40 |
+
|
41 |
+
// Math.abs(diff in full ISO years - diff in calendar ISO years) === 1
|
42 |
+
// if last calendar ISO year is not full
|
43 |
+
// If so, result must be decreased by 1 in absolute value
|
44 |
+
const isLastISOWeekYearNotFull = Number(
|
45 |
+
compareAsc(_dateLeft, _dateRight) === -sign,
|
46 |
+
);
|
47 |
+
const result = sign * (difference - isLastISOWeekYearNotFull);
|
48 |
+
// Prevent negative zero
|
49 |
+
return result === 0 ? 0 : result;
|
50 |
+
}
|
51 |
+
|
52 |
+
// Fallback for modularized imports:
|
53 |
+
export default differenceInISOWeekYears;
|
workers1/auto3d/node_modules/date-fns/differenceInMilliseconds.d.mts
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInMilliseconds
|
3 |
+
* @category Millisecond Helpers
|
4 |
+
* @summary Get the number of milliseconds between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of milliseconds between the given dates.
|
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 dateLeft - The later date
|
12 |
+
* @param dateRight - The earlier date
|
13 |
+
*
|
14 |
+
* @returns The number of milliseconds
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // How many milliseconds are between
|
18 |
+
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
19 |
+
* const result = differenceInMilliseconds(
|
20 |
+
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
21 |
+
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
22 |
+
* )
|
23 |
+
* //=> 1100
|
24 |
+
*/
|
25 |
+
export declare function differenceInMilliseconds<DateType extends Date>(
|
26 |
+
dateLeft: DateType | number | string,
|
27 |
+
dateRight: DateType | number | string,
|
28 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInMilliseconds.d.ts
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInMilliseconds
|
3 |
+
* @category Millisecond Helpers
|
4 |
+
* @summary Get the number of milliseconds between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of milliseconds between the given dates.
|
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 dateLeft - The later date
|
12 |
+
* @param dateRight - The earlier date
|
13 |
+
*
|
14 |
+
* @returns The number of milliseconds
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // How many milliseconds are between
|
18 |
+
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
19 |
+
* const result = differenceInMilliseconds(
|
20 |
+
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
21 |
+
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
22 |
+
* )
|
23 |
+
* //=> 1100
|
24 |
+
*/
|
25 |
+
export declare function differenceInMilliseconds<DateType extends Date>(
|
26 |
+
dateLeft: DateType | number | string,
|
27 |
+
dateRight: DateType | number | string,
|
28 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInMilliseconds.js
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInMilliseconds = differenceInMilliseconds;
|
3 |
+
var _index = require("./toDate.js");
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @name differenceInMilliseconds
|
7 |
+
* @category Millisecond Helpers
|
8 |
+
* @summary Get the number of milliseconds between the given dates.
|
9 |
+
*
|
10 |
+
* @description
|
11 |
+
* Get the number of milliseconds between the given dates.
|
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 dateLeft - The later date
|
16 |
+
* @param dateRight - The earlier date
|
17 |
+
*
|
18 |
+
* @returns The number of milliseconds
|
19 |
+
*
|
20 |
+
* @example
|
21 |
+
* // How many milliseconds are between
|
22 |
+
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
23 |
+
* const result = differenceInMilliseconds(
|
24 |
+
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
25 |
+
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
26 |
+
* )
|
27 |
+
* //=> 1100
|
28 |
+
*/
|
29 |
+
function differenceInMilliseconds(dateLeft, dateRight) {
|
30 |
+
return +(0, _index.toDate)(dateLeft) - +(0, _index.toDate)(dateRight);
|
31 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInMilliseconds.mjs
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { toDate } from "./toDate.mjs";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @name differenceInMilliseconds
|
5 |
+
* @category Millisecond Helpers
|
6 |
+
* @summary Get the number of milliseconds between the given dates.
|
7 |
+
*
|
8 |
+
* @description
|
9 |
+
* Get the number of milliseconds between the given dates.
|
10 |
+
*
|
11 |
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
12 |
+
*
|
13 |
+
* @param dateLeft - The later date
|
14 |
+
* @param dateRight - The earlier date
|
15 |
+
*
|
16 |
+
* @returns The number of milliseconds
|
17 |
+
*
|
18 |
+
* @example
|
19 |
+
* // How many milliseconds are between
|
20 |
+
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
21 |
+
* const result = differenceInMilliseconds(
|
22 |
+
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
23 |
+
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
24 |
+
* )
|
25 |
+
* //=> 1100
|
26 |
+
*/
|
27 |
+
export function differenceInMilliseconds(dateLeft, dateRight) {
|
28 |
+
return +toDate(dateLeft) - +toDate(dateRight);
|
29 |
+
}
|
30 |
+
|
31 |
+
// Fallback for modularized imports:
|
32 |
+
export default differenceInMilliseconds;
|
workers1/auto3d/node_modules/date-fns/differenceInMinutes.d.mts
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { RoundingOptions } from "./types.js";
|
2 |
+
/**
|
3 |
+
* The {@link differenceInMinutes} function options.
|
4 |
+
*/
|
5 |
+
export interface DifferenceInMinutesOptions extends RoundingOptions {}
|
6 |
+
/**
|
7 |
+
* @name differenceInMinutes
|
8 |
+
* @category Minute Helpers
|
9 |
+
* @summary Get the number of minutes between the given dates.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the signed number of full (rounded towards 0) minutes between the given dates.
|
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 dateLeft - The later date
|
17 |
+
* @param dateRight - The earlier date
|
18 |
+
* @param options - An object with options.
|
19 |
+
*
|
20 |
+
* @returns The number of minutes
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?
|
24 |
+
* const result = differenceInMinutes(
|
25 |
+
* new Date(2014, 6, 2, 12, 20, 0),
|
26 |
+
* new Date(2014, 6, 2, 12, 7, 59)
|
27 |
+
* )
|
28 |
+
* //=> 12
|
29 |
+
*
|
30 |
+
* @example
|
31 |
+
* // How many minutes are between 10:01:59 and 10:00:00
|
32 |
+
* const result = differenceInMinutes(
|
33 |
+
* new Date(2000, 0, 1, 10, 0, 0),
|
34 |
+
* new Date(2000, 0, 1, 10, 1, 59)
|
35 |
+
* )
|
36 |
+
* //=> -1
|
37 |
+
*/
|
38 |
+
export declare function differenceInMinutes<DateType extends Date>(
|
39 |
+
dateLeft: DateType | number | string,
|
40 |
+
dateRight: DateType | number | string,
|
41 |
+
options?: DifferenceInMinutesOptions,
|
42 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInMinutes.d.ts
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { RoundingOptions } from "./types.js";
|
2 |
+
/**
|
3 |
+
* The {@link differenceInMinutes} function options.
|
4 |
+
*/
|
5 |
+
export interface DifferenceInMinutesOptions extends RoundingOptions {}
|
6 |
+
/**
|
7 |
+
* @name differenceInMinutes
|
8 |
+
* @category Minute Helpers
|
9 |
+
* @summary Get the number of minutes between the given dates.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the signed number of full (rounded towards 0) minutes between the given dates.
|
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 dateLeft - The later date
|
17 |
+
* @param dateRight - The earlier date
|
18 |
+
* @param options - An object with options.
|
19 |
+
*
|
20 |
+
* @returns The number of minutes
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?
|
24 |
+
* const result = differenceInMinutes(
|
25 |
+
* new Date(2014, 6, 2, 12, 20, 0),
|
26 |
+
* new Date(2014, 6, 2, 12, 7, 59)
|
27 |
+
* )
|
28 |
+
* //=> 12
|
29 |
+
*
|
30 |
+
* @example
|
31 |
+
* // How many minutes are between 10:01:59 and 10:00:00
|
32 |
+
* const result = differenceInMinutes(
|
33 |
+
* new Date(2000, 0, 1, 10, 0, 0),
|
34 |
+
* new Date(2000, 0, 1, 10, 1, 59)
|
35 |
+
* )
|
36 |
+
* //=> -1
|
37 |
+
*/
|
38 |
+
export declare function differenceInMinutes<DateType extends Date>(
|
39 |
+
dateLeft: DateType | number | string,
|
40 |
+
dateRight: DateType | number | string,
|
41 |
+
options?: DifferenceInMinutesOptions,
|
42 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInMinutes.js
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInMinutes = differenceInMinutes;
|
3 |
+
var _index = require("./_lib/getRoundingMethod.js");
|
4 |
+
var _index2 = require("./constants.js");
|
5 |
+
var _index3 = require("./differenceInMilliseconds.js");
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The {@link differenceInMinutes} function options.
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @name differenceInMinutes
|
13 |
+
* @category Minute Helpers
|
14 |
+
* @summary Get the number of minutes between the given dates.
|
15 |
+
*
|
16 |
+
* @description
|
17 |
+
* Get the signed number of full (rounded towards 0) minutes between the given dates.
|
18 |
+
*
|
19 |
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
20 |
+
*
|
21 |
+
* @param dateLeft - The later date
|
22 |
+
* @param dateRight - The earlier date
|
23 |
+
* @param options - An object with options.
|
24 |
+
*
|
25 |
+
* @returns The number of minutes
|
26 |
+
*
|
27 |
+
* @example
|
28 |
+
* // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?
|
29 |
+
* const result = differenceInMinutes(
|
30 |
+
* new Date(2014, 6, 2, 12, 20, 0),
|
31 |
+
* new Date(2014, 6, 2, 12, 7, 59)
|
32 |
+
* )
|
33 |
+
* //=> 12
|
34 |
+
*
|
35 |
+
* @example
|
36 |
+
* // How many minutes are between 10:01:59 and 10:00:00
|
37 |
+
* const result = differenceInMinutes(
|
38 |
+
* new Date(2000, 0, 1, 10, 0, 0),
|
39 |
+
* new Date(2000, 0, 1, 10, 1, 59)
|
40 |
+
* )
|
41 |
+
* //=> -1
|
42 |
+
*/
|
43 |
+
function differenceInMinutes(dateLeft, dateRight, options) {
|
44 |
+
const diff =
|
45 |
+
(0, _index3.differenceInMilliseconds)(dateLeft, dateRight) /
|
46 |
+
_index2.millisecondsInMinute;
|
47 |
+
return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff);
|
48 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInMinutes.mjs
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getRoundingMethod } from "./_lib/getRoundingMethod.mjs";
|
2 |
+
import { millisecondsInMinute } from "./constants.mjs";
|
3 |
+
import { differenceInMilliseconds } from "./differenceInMilliseconds.mjs";
|
4 |
+
|
5 |
+
/**
|
6 |
+
* The {@link differenceInMinutes} function options.
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @name differenceInMinutes
|
11 |
+
* @category Minute Helpers
|
12 |
+
* @summary Get the number of minutes between the given dates.
|
13 |
+
*
|
14 |
+
* @description
|
15 |
+
* Get the signed number of full (rounded towards 0) minutes between the given dates.
|
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 dateLeft - The later date
|
20 |
+
* @param dateRight - The earlier date
|
21 |
+
* @param options - An object with options.
|
22 |
+
*
|
23 |
+
* @returns The number of minutes
|
24 |
+
*
|
25 |
+
* @example
|
26 |
+
* // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?
|
27 |
+
* const result = differenceInMinutes(
|
28 |
+
* new Date(2014, 6, 2, 12, 20, 0),
|
29 |
+
* new Date(2014, 6, 2, 12, 7, 59)
|
30 |
+
* )
|
31 |
+
* //=> 12
|
32 |
+
*
|
33 |
+
* @example
|
34 |
+
* // How many minutes are between 10:01:59 and 10:00:00
|
35 |
+
* const result = differenceInMinutes(
|
36 |
+
* new Date(2000, 0, 1, 10, 0, 0),
|
37 |
+
* new Date(2000, 0, 1, 10, 1, 59)
|
38 |
+
* )
|
39 |
+
* //=> -1
|
40 |
+
*/
|
41 |
+
export function differenceInMinutes(dateLeft, dateRight, options) {
|
42 |
+
const diff =
|
43 |
+
differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
|
44 |
+
return getRoundingMethod(options?.roundingMethod)(diff);
|
45 |
+
}
|
46 |
+
|
47 |
+
// Fallback for modularized imports:
|
48 |
+
export default differenceInMinutes;
|
workers1/auto3d/node_modules/date-fns/differenceInMonths.d.mts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInMonths
|
3 |
+
* @category Month Helpers
|
4 |
+
* @summary Get the number of full months between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of full months between the given dates using trunc as a default rounding method.
|
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 dateLeft - The later date
|
12 |
+
* @param dateRight - The earlier date
|
13 |
+
*
|
14 |
+
* @returns The number of full months
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // How many full months are between 31 January 2014 and 1 September 2014?
|
18 |
+
* const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))
|
19 |
+
* //=> 7
|
20 |
+
*/
|
21 |
+
export declare function differenceInMonths<DateType extends Date>(
|
22 |
+
dateLeft: DateType | number | string,
|
23 |
+
dateRight: DateType | number | string,
|
24 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInMonths.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @name differenceInMonths
|
3 |
+
* @category Month Helpers
|
4 |
+
* @summary Get the number of full months between the given dates.
|
5 |
+
*
|
6 |
+
* @description
|
7 |
+
* Get the number of full months between the given dates using trunc as a default rounding method.
|
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 dateLeft - The later date
|
12 |
+
* @param dateRight - The earlier date
|
13 |
+
*
|
14 |
+
* @returns The number of full months
|
15 |
+
*
|
16 |
+
* @example
|
17 |
+
* // How many full months are between 31 January 2014 and 1 September 2014?
|
18 |
+
* const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))
|
19 |
+
* //=> 7
|
20 |
+
*/
|
21 |
+
export declare function differenceInMonths<DateType extends Date>(
|
22 |
+
dateLeft: DateType | number | string,
|
23 |
+
dateRight: DateType | number | string,
|
24 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInMonths.js
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInMonths = differenceInMonths;
|
3 |
+
var _index = require("./compareAsc.js");
|
4 |
+
var _index2 = require("./differenceInCalendarMonths.js");
|
5 |
+
var _index3 = require("./isLastDayOfMonth.js");
|
6 |
+
var _index4 = require("./toDate.js");
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @name differenceInMonths
|
10 |
+
* @category Month Helpers
|
11 |
+
* @summary Get the number of full months between the given dates.
|
12 |
+
*
|
13 |
+
* @description
|
14 |
+
* Get the number of full months between the given dates using trunc as a default rounding method.
|
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 dateLeft - The later date
|
19 |
+
* @param dateRight - The earlier date
|
20 |
+
*
|
21 |
+
* @returns The number of full months
|
22 |
+
*
|
23 |
+
* @example
|
24 |
+
* // How many full months are between 31 January 2014 and 1 September 2014?
|
25 |
+
* const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))
|
26 |
+
* //=> 7
|
27 |
+
*/
|
28 |
+
function differenceInMonths(dateLeft, dateRight) {
|
29 |
+
const _dateLeft = (0, _index4.toDate)(dateLeft);
|
30 |
+
const _dateRight = (0, _index4.toDate)(dateRight);
|
31 |
+
|
32 |
+
const sign = (0, _index.compareAsc)(_dateLeft, _dateRight);
|
33 |
+
const difference = Math.abs(
|
34 |
+
(0, _index2.differenceInCalendarMonths)(_dateLeft, _dateRight),
|
35 |
+
);
|
36 |
+
let result;
|
37 |
+
|
38 |
+
// Check for the difference of less than month
|
39 |
+
if (difference < 1) {
|
40 |
+
result = 0;
|
41 |
+
} else {
|
42 |
+
if (_dateLeft.getMonth() === 1 && _dateLeft.getDate() > 27) {
|
43 |
+
// This will check if the date is end of Feb and assign a higher end of month date
|
44 |
+
// to compare it with Jan
|
45 |
+
_dateLeft.setDate(30);
|
46 |
+
}
|
47 |
+
|
48 |
+
_dateLeft.setMonth(_dateLeft.getMonth() - sign * difference);
|
49 |
+
|
50 |
+
// Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full
|
51 |
+
// If so, result must be decreased by 1 in absolute value
|
52 |
+
let isLastMonthNotFull =
|
53 |
+
(0, _index.compareAsc)(_dateLeft, _dateRight) === -sign;
|
54 |
+
|
55 |
+
// Check for cases of one full calendar month
|
56 |
+
if (
|
57 |
+
(0, _index3.isLastDayOfMonth)((0, _index4.toDate)(dateLeft)) &&
|
58 |
+
difference === 1 &&
|
59 |
+
(0, _index.compareAsc)(dateLeft, _dateRight) === 1
|
60 |
+
) {
|
61 |
+
isLastMonthNotFull = false;
|
62 |
+
}
|
63 |
+
|
64 |
+
result = sign * (difference - Number(isLastMonthNotFull));
|
65 |
+
}
|
66 |
+
|
67 |
+
// Prevent negative zero
|
68 |
+
return result === 0 ? 0 : result;
|
69 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInMonths.mjs
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { compareAsc } from "./compareAsc.mjs";
|
2 |
+
import { differenceInCalendarMonths } from "./differenceInCalendarMonths.mjs";
|
3 |
+
import { isLastDayOfMonth } from "./isLastDayOfMonth.mjs";
|
4 |
+
import { toDate } from "./toDate.mjs";
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @name differenceInMonths
|
8 |
+
* @category Month Helpers
|
9 |
+
* @summary Get the number of full months between the given dates.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the number of full months between the given dates using trunc as a default rounding method.
|
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 dateLeft - The later date
|
17 |
+
* @param dateRight - The earlier date
|
18 |
+
*
|
19 |
+
* @returns The number of full months
|
20 |
+
*
|
21 |
+
* @example
|
22 |
+
* // How many full months are between 31 January 2014 and 1 September 2014?
|
23 |
+
* const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))
|
24 |
+
* //=> 7
|
25 |
+
*/
|
26 |
+
export function differenceInMonths(dateLeft, dateRight) {
|
27 |
+
const _dateLeft = toDate(dateLeft);
|
28 |
+
const _dateRight = toDate(dateRight);
|
29 |
+
|
30 |
+
const sign = compareAsc(_dateLeft, _dateRight);
|
31 |
+
const difference = Math.abs(
|
32 |
+
differenceInCalendarMonths(_dateLeft, _dateRight),
|
33 |
+
);
|
34 |
+
let result;
|
35 |
+
|
36 |
+
// Check for the difference of less than month
|
37 |
+
if (difference < 1) {
|
38 |
+
result = 0;
|
39 |
+
} else {
|
40 |
+
if (_dateLeft.getMonth() === 1 && _dateLeft.getDate() > 27) {
|
41 |
+
// This will check if the date is end of Feb and assign a higher end of month date
|
42 |
+
// to compare it with Jan
|
43 |
+
_dateLeft.setDate(30);
|
44 |
+
}
|
45 |
+
|
46 |
+
_dateLeft.setMonth(_dateLeft.getMonth() - sign * difference);
|
47 |
+
|
48 |
+
// Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full
|
49 |
+
// If so, result must be decreased by 1 in absolute value
|
50 |
+
let isLastMonthNotFull = compareAsc(_dateLeft, _dateRight) === -sign;
|
51 |
+
|
52 |
+
// Check for cases of one full calendar month
|
53 |
+
if (
|
54 |
+
isLastDayOfMonth(toDate(dateLeft)) &&
|
55 |
+
difference === 1 &&
|
56 |
+
compareAsc(dateLeft, _dateRight) === 1
|
57 |
+
) {
|
58 |
+
isLastMonthNotFull = false;
|
59 |
+
}
|
60 |
+
|
61 |
+
result = sign * (difference - Number(isLastMonthNotFull));
|
62 |
+
}
|
63 |
+
|
64 |
+
// Prevent negative zero
|
65 |
+
return result === 0 ? 0 : result;
|
66 |
+
}
|
67 |
+
|
68 |
+
// Fallback for modularized imports:
|
69 |
+
export default differenceInMonths;
|
workers1/auto3d/node_modules/date-fns/differenceInQuarters.d.mts
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { RoundingOptions } from "./types.js";
|
2 |
+
/**
|
3 |
+
* The {@link differenceInQuarters} function options.
|
4 |
+
*/
|
5 |
+
export interface DifferenceInQuartersOptions extends RoundingOptions {}
|
6 |
+
/**
|
7 |
+
* @name differenceInQuarters
|
8 |
+
* @category Quarter Helpers
|
9 |
+
* @summary Get the number of quarters between the given dates.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the number of quarters between the given dates.
|
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 dateLeft - The later date
|
17 |
+
* @param dateRight - The earlier date
|
18 |
+
* @param options - An object with options.
|
19 |
+
*
|
20 |
+
* @returns The number of full quarters
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // How many full quarters are between 31 December 2013 and 2 July 2014?
|
24 |
+
* const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31))
|
25 |
+
* //=> 2
|
26 |
+
*/
|
27 |
+
export declare function differenceInQuarters<DateType extends Date>(
|
28 |
+
dateLeft: DateType | number | string,
|
29 |
+
dateRight: DateType | number | string,
|
30 |
+
options?: DifferenceInQuartersOptions,
|
31 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInQuarters.d.ts
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { RoundingOptions } from "./types.js";
|
2 |
+
/**
|
3 |
+
* The {@link differenceInQuarters} function options.
|
4 |
+
*/
|
5 |
+
export interface DifferenceInQuartersOptions extends RoundingOptions {}
|
6 |
+
/**
|
7 |
+
* @name differenceInQuarters
|
8 |
+
* @category Quarter Helpers
|
9 |
+
* @summary Get the number of quarters between the given dates.
|
10 |
+
*
|
11 |
+
* @description
|
12 |
+
* Get the number of quarters between the given dates.
|
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 dateLeft - The later date
|
17 |
+
* @param dateRight - The earlier date
|
18 |
+
* @param options - An object with options.
|
19 |
+
*
|
20 |
+
* @returns The number of full quarters
|
21 |
+
*
|
22 |
+
* @example
|
23 |
+
* // How many full quarters are between 31 December 2013 and 2 July 2014?
|
24 |
+
* const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31))
|
25 |
+
* //=> 2
|
26 |
+
*/
|
27 |
+
export declare function differenceInQuarters<DateType extends Date>(
|
28 |
+
dateLeft: DateType | number | string,
|
29 |
+
dateRight: DateType | number | string,
|
30 |
+
options?: DifferenceInQuartersOptions,
|
31 |
+
): number;
|
workers1/auto3d/node_modules/date-fns/differenceInQuarters.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
exports.differenceInQuarters = differenceInQuarters;
|
3 |
+
var _index = require("./_lib/getRoundingMethod.js");
|
4 |
+
var _index2 = require("./differenceInMonths.js");
|
5 |
+
|
6 |
+
/**
|
7 |
+
* The {@link differenceInQuarters} function options.
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* @name differenceInQuarters
|
12 |
+
* @category Quarter Helpers
|
13 |
+
* @summary Get the number of quarters between the given dates.
|
14 |
+
*
|
15 |
+
* @description
|
16 |
+
* Get the number of quarters between the given dates.
|
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 dateLeft - The later date
|
21 |
+
* @param dateRight - The earlier date
|
22 |
+
* @param options - An object with options.
|
23 |
+
*
|
24 |
+
* @returns The number of full quarters
|
25 |
+
*
|
26 |
+
* @example
|
27 |
+
* // How many full quarters are between 31 December 2013 and 2 July 2014?
|
28 |
+
* const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31))
|
29 |
+
* //=> 2
|
30 |
+
*/
|
31 |
+
function differenceInQuarters(dateLeft, dateRight, options) {
|
32 |
+
const diff = (0, _index2.differenceInMonths)(dateLeft, dateRight) / 3;
|
33 |
+
return (0, _index.getRoundingMethod)(options?.roundingMethod)(diff);
|
34 |
+
}
|
workers1/auto3d/node_modules/date-fns/differenceInQuarters.mjs
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getRoundingMethod } from "./_lib/getRoundingMethod.mjs";
|
2 |
+
import { differenceInMonths } from "./differenceInMonths.mjs";
|
3 |
+
|
4 |
+
/**
|
5 |
+
* The {@link differenceInQuarters} function options.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @name differenceInQuarters
|
10 |
+
* @category Quarter Helpers
|
11 |
+
* @summary Get the number of quarters between the given dates.
|
12 |
+
*
|
13 |
+
* @description
|
14 |
+
* Get the number of quarters between the given dates.
|
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 dateLeft - The later date
|
19 |
+
* @param dateRight - The earlier date
|
20 |
+
* @param options - An object with options.
|
21 |
+
*
|
22 |
+
* @returns The number of full quarters
|
23 |
+
*
|
24 |
+
* @example
|
25 |
+
* // How many full quarters are between 31 December 2013 and 2 July 2014?
|
26 |
+
* const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31))
|
27 |
+
* //=> 2
|
28 |
+
*/
|
29 |
+
export function differenceInQuarters(dateLeft, dateRight, options) {
|
30 |
+
const diff = differenceInMonths(dateLeft, dateRight) / 3;
|
31 |
+
return getRoundingMethod(options?.roundingMethod)(diff);
|
32 |
+
}
|
33 |
+
|
34 |
+
// Fallback for modularized imports:
|
35 |
+
export default differenceInQuarters;
|