@gobrand/tiempo 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/dist/chunk-4E7OGJ3F.js +10 -0
- package/dist/chunk-4E7OGJ3F.js.map +1 -0
- package/dist/chunk-BPZ7BRJW.js +10 -0
- package/dist/chunk-BPZ7BRJW.js.map +1 -0
- package/dist/chunk-O6RIN7K3.js +10 -0
- package/dist/chunk-O6RIN7K3.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -25
- package/dist/isPlainDateAfter.d.ts +21 -0
- package/dist/isPlainDateAfter.d.ts.map +1 -0
- package/dist/isPlainDateAfter.js +7 -0
- package/dist/isPlainDateAfter.js.map +1 -0
- package/dist/isPlainDateAfter.test.d.ts +2 -0
- package/dist/isPlainDateAfter.test.d.ts.map +1 -0
- package/dist/isPlainDateBefore.d.ts +21 -0
- package/dist/isPlainDateBefore.d.ts.map +1 -0
- package/dist/isPlainDateBefore.js +7 -0
- package/dist/isPlainDateBefore.js.map +1 -0
- package/dist/isPlainDateBefore.test.d.ts +2 -0
- package/dist/isPlainDateBefore.test.d.ts.map +1 -0
- package/dist/isPlainDateEqual.d.ts +21 -0
- package/dist/isPlainDateEqual.d.ts.map +1 -0
- package/dist/isPlainDateEqual.js +7 -0
- package/dist/isPlainDateEqual.js.map +1 -0
- package/dist/isPlainDateEqual.test.d.ts +2 -0
- package/dist/isPlainDateEqual.test.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -853,6 +853,44 @@ const minutesUntil = differenceInMinutes(meeting, now);
|
|
|
853
853
|
console.log(`Meeting starts in ${minutesUntil} minutes`);
|
|
854
854
|
```
|
|
855
855
|
|
|
856
|
+
### PlainDate Comparisons
|
|
857
|
+
|
|
858
|
+
For comparing calendar dates without time or timezone considerations, tiempo provides dedicated PlainDate comparison functions. These are useful for calendars, date pickers, and scheduling UIs where you work with pure dates.
|
|
859
|
+
|
|
860
|
+
#### `isPlainDateBefore(date1, date2)` / `isPlainDateAfter(date1, date2)` / `isPlainDateEqual(date1, date2)`
|
|
861
|
+
|
|
862
|
+
Compare two `Temporal.PlainDate` values. Unlike `isBefore`/`isAfter` which compare instants in time, these functions compare pure calendar dates.
|
|
863
|
+
|
|
864
|
+
```typescript
|
|
865
|
+
import { isPlainDateBefore, isPlainDateAfter, isPlainDateEqual } from '@gobrand/tiempo';
|
|
866
|
+
|
|
867
|
+
const jan20 = Temporal.PlainDate.from('2025-01-20');
|
|
868
|
+
const jan25 = Temporal.PlainDate.from('2025-01-25');
|
|
869
|
+
|
|
870
|
+
isPlainDateBefore(jan20, jan25); // true
|
|
871
|
+
isPlainDateBefore(jan25, jan20); // false
|
|
872
|
+
|
|
873
|
+
isPlainDateAfter(jan25, jan20); // true
|
|
874
|
+
isPlainDateAfter(jan20, jan25); // false
|
|
875
|
+
|
|
876
|
+
isPlainDateEqual(jan20, Temporal.PlainDate.from('2025-01-20')); // true
|
|
877
|
+
isPlainDateEqual(jan20, jan25); // false
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
**When to use PlainDate vs Instant/ZonedDateTime:**
|
|
881
|
+
- Use `isPlainDateBefore`/`isPlainDateAfter` when comparing calendar dates (e.g., "Is January 20th before January 25th?")
|
|
882
|
+
- Use `isBefore`/`isAfter` when comparing specific moments in time (e.g., "Did event A happen before event B?")
|
|
883
|
+
|
|
884
|
+
```typescript
|
|
885
|
+
// Calendar UI: Disable dates before today
|
|
886
|
+
const isDateDisabled = (date: Temporal.PlainDate) =>
|
|
887
|
+
isPlainDateBefore(date, today());
|
|
888
|
+
|
|
889
|
+
// Booking system: Check if selected date is in the past
|
|
890
|
+
const isPastDate = (date: Temporal.PlainDate) =>
|
|
891
|
+
isPlainDateBefore(date, today());
|
|
892
|
+
```
|
|
893
|
+
|
|
856
894
|
## Browser Support
|
|
857
895
|
|
|
858
896
|
The Temporal API is a Stage 3 TC39 proposal. The polyfill `@js-temporal/polyfill` is included as a dependency, so you're ready to go!
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/isPlainDateBefore.ts
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
function isPlainDateBefore(date1, date2) {
|
|
4
|
+
return Temporal.PlainDate.compare(date1, date2) < 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
isPlainDateBefore
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=chunk-4E7OGJ3F.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isPlainDateBefore.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill';\n\n/**\n * Returns true if the first plain date is before the second plain date.\n * Compares calendar dates without time or timezone considerations.\n *\n * @param date1 - First plain date\n * @param date2 - Second plain date\n * @returns true if date1 is before date2, false otherwise\n *\n * @example\n * ```ts\n * const jan20 = Temporal.PlainDate.from('2025-01-20');\n * const jan25 = Temporal.PlainDate.from('2025-01-25');\n *\n * isPlainDateBefore(jan20, jan25); // true\n * isPlainDateBefore(jan25, jan20); // false\n * isPlainDateBefore(jan20, jan20); // false\n * ```\n */\nexport function isPlainDateBefore(\n date1: Temporal.PlainDate,\n date2: Temporal.PlainDate\n): boolean {\n return Temporal.PlainDate.compare(date1, date2) < 0;\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AAoBlB,SAAS,kBACd,OACA,OACS;AACT,SAAO,SAAS,UAAU,QAAQ,OAAO,KAAK,IAAI;AACpD;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/isPlainDateAfter.ts
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
function isPlainDateAfter(date1, date2) {
|
|
4
|
+
return Temporal.PlainDate.compare(date1, date2) > 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
isPlainDateAfter
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=chunk-BPZ7BRJW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isPlainDateAfter.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill';\n\n/**\n * Returns true if the first plain date is after the second plain date.\n * Compares calendar dates without time or timezone considerations.\n *\n * @param date1 - First plain date\n * @param date2 - Second plain date\n * @returns true if date1 is after date2, false otherwise\n *\n * @example\n * ```ts\n * const jan20 = Temporal.PlainDate.from('2025-01-20');\n * const jan25 = Temporal.PlainDate.from('2025-01-25');\n *\n * isPlainDateAfter(jan25, jan20); // true\n * isPlainDateAfter(jan20, jan25); // false\n * isPlainDateAfter(jan20, jan20); // false\n * ```\n */\nexport function isPlainDateAfter(\n date1: Temporal.PlainDate,\n date2: Temporal.PlainDate\n): boolean {\n return Temporal.PlainDate.compare(date1, date2) > 0;\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AAoBlB,SAAS,iBACd,OACA,OACS;AACT,SAAO,SAAS,UAAU,QAAQ,OAAO,KAAK,IAAI;AACpD;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/isPlainDateEqual.ts
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
function isPlainDateEqual(date1, date2) {
|
|
4
|
+
return Temporal.PlainDate.compare(date1, date2) === 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
isPlainDateEqual
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=chunk-O6RIN7K3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isPlainDateEqual.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill';\n\n/**\n * Returns true if the two plain dates are equal.\n * Compares calendar dates without time or timezone considerations.\n *\n * @param date1 - First plain date\n * @param date2 - Second plain date\n * @returns true if date1 equals date2, false otherwise\n *\n * @example\n * ```ts\n * const jan20a = Temporal.PlainDate.from('2025-01-20');\n * const jan20b = Temporal.PlainDate.from('2025-01-20');\n * const jan25 = Temporal.PlainDate.from('2025-01-25');\n *\n * isPlainDateEqual(jan20a, jan20b); // true\n * isPlainDateEqual(jan20a, jan25); // false\n * ```\n */\nexport function isPlainDateEqual(\n date1: Temporal.PlainDate,\n date2: Temporal.PlainDate\n): boolean {\n return Temporal.PlainDate.compare(date1, date2) === 0;\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AAoBlB,SAAS,iBACd,OACA,OACS;AACT,SAAO,SAAS,UAAU,QAAQ,OAAO,KAAK,MAAM;AACtD;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -58,4 +58,7 @@ export { differenceInWeeks } from './differenceInWeeks';
|
|
|
58
58
|
export { differenceInMonths } from './differenceInMonths';
|
|
59
59
|
export { differenceInYears } from './differenceInYears';
|
|
60
60
|
export { intlFormatDistance, type IntlFormatDistanceOptions, } from './intlFormatDistance';
|
|
61
|
+
export { isPlainDateBefore } from './isPlainDateBefore';
|
|
62
|
+
export { isPlainDateAfter } from './isPlainDateAfter';
|
|
63
|
+
export { isPlainDateEqual } from './isPlainDateEqual';
|
|
61
64
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,GAA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
+
} from "./chunk-BH2YB4MV.js";
|
|
7
|
+
import {
|
|
8
|
+
subWeeks
|
|
9
|
+
} from "./chunk-U4RNUZXO.js";
|
|
10
|
+
import {
|
|
11
|
+
subYears
|
|
12
|
+
} from "./chunk-AHMKY474.js";
|
|
1
13
|
import {
|
|
2
14
|
toDate
|
|
3
15
|
} from "./chunk-TGKWBQ7L.js";
|
|
@@ -11,8 +23,14 @@ import {
|
|
|
11
23
|
toZonedTime
|
|
12
24
|
} from "./chunk-2MP3ESL7.js";
|
|
13
25
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./chunk-
|
|
26
|
+
startOfYear
|
|
27
|
+
} from "./chunk-YR2UCUIT.js";
|
|
28
|
+
import {
|
|
29
|
+
subDays
|
|
30
|
+
} from "./chunk-YKBP3G7L.js";
|
|
31
|
+
import {
|
|
32
|
+
subHours
|
|
33
|
+
} from "./chunk-XW5MLXX5.js";
|
|
16
34
|
import {
|
|
17
35
|
subMicroseconds
|
|
18
36
|
} from "./chunk-BQBLSXK2.js";
|
|
@@ -29,14 +47,14 @@ import {
|
|
|
29
47
|
subNanoseconds
|
|
30
48
|
} from "./chunk-WVHAYLBW.js";
|
|
31
49
|
import {
|
|
32
|
-
|
|
33
|
-
} from "./chunk-
|
|
50
|
+
isSameNanosecond
|
|
51
|
+
} from "./chunk-S63QUP4W.js";
|
|
34
52
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./chunk-
|
|
53
|
+
isSameSecond
|
|
54
|
+
} from "./chunk-CY746ZUQ.js";
|
|
37
55
|
import {
|
|
38
|
-
|
|
39
|
-
} from "./chunk-
|
|
56
|
+
isSameWeek
|
|
57
|
+
} from "./chunk-JOD4ATPE.js";
|
|
40
58
|
import {
|
|
41
59
|
isSameYear
|
|
42
60
|
} from "./chunk-VLZ3HQQA.js";
|
|
@@ -53,14 +71,14 @@ import {
|
|
|
53
71
|
startOfWeek
|
|
54
72
|
} from "./chunk-2WMXB7QL.js";
|
|
55
73
|
import {
|
|
56
|
-
|
|
57
|
-
} from "./chunk-
|
|
74
|
+
isPlainDateBefore
|
|
75
|
+
} from "./chunk-4E7OGJ3F.js";
|
|
58
76
|
import {
|
|
59
|
-
|
|
60
|
-
} from "./chunk-
|
|
77
|
+
isPlainDateEqual
|
|
78
|
+
} from "./chunk-O6RIN7K3.js";
|
|
61
79
|
import {
|
|
62
|
-
|
|
63
|
-
} from "./chunk-
|
|
80
|
+
isSameDay
|
|
81
|
+
} from "./chunk-RW3C2677.js";
|
|
64
82
|
import {
|
|
65
83
|
isSameHour
|
|
66
84
|
} from "./chunk-EEQ3REET.js";
|
|
@@ -76,15 +94,6 @@ import {
|
|
|
76
94
|
import {
|
|
77
95
|
isSameMonth
|
|
78
96
|
} from "./chunk-ADQTZVMH.js";
|
|
79
|
-
import {
|
|
80
|
-
isSameNanosecond
|
|
81
|
-
} from "./chunk-S63QUP4W.js";
|
|
82
|
-
import {
|
|
83
|
-
isSameSecond
|
|
84
|
-
} from "./chunk-CY746ZUQ.js";
|
|
85
|
-
import {
|
|
86
|
-
isSameWeek
|
|
87
|
-
} from "./chunk-JOD4ATPE.js";
|
|
88
97
|
import {
|
|
89
98
|
format
|
|
90
99
|
} from "./chunk-2G5RJGPR.js";
|
|
@@ -104,8 +113,8 @@ import {
|
|
|
104
113
|
isPast
|
|
105
114
|
} from "./chunk-2H4KLXGL.js";
|
|
106
115
|
import {
|
|
107
|
-
|
|
108
|
-
} from "./chunk-
|
|
116
|
+
isPlainDateAfter
|
|
117
|
+
} from "./chunk-BPZ7BRJW.js";
|
|
109
118
|
import {
|
|
110
119
|
differenceInNanoseconds
|
|
111
120
|
} from "./chunk-OABS374T.js";
|
|
@@ -211,6 +220,9 @@ export {
|
|
|
211
220
|
isBefore,
|
|
212
221
|
isFuture,
|
|
213
222
|
isPast,
|
|
223
|
+
isPlainDateAfter,
|
|
224
|
+
isPlainDateBefore,
|
|
225
|
+
isPlainDateEqual,
|
|
214
226
|
isSameDay,
|
|
215
227
|
isSameHour,
|
|
216
228
|
isSameMicrosecond,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the first plain date is after the second plain date.
|
|
4
|
+
* Compares calendar dates without time or timezone considerations.
|
|
5
|
+
*
|
|
6
|
+
* @param date1 - First plain date
|
|
7
|
+
* @param date2 - Second plain date
|
|
8
|
+
* @returns true if date1 is after date2, false otherwise
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const jan20 = Temporal.PlainDate.from('2025-01-20');
|
|
13
|
+
* const jan25 = Temporal.PlainDate.from('2025-01-25');
|
|
14
|
+
*
|
|
15
|
+
* isPlainDateAfter(jan25, jan20); // true
|
|
16
|
+
* isPlainDateAfter(jan20, jan25); // false
|
|
17
|
+
* isPlainDateAfter(jan20, jan20); // false
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function isPlainDateAfter(date1: Temporal.PlainDate, date2: Temporal.PlainDate): boolean;
|
|
21
|
+
//# sourceMappingURL=isPlainDateAfter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPlainDateAfter.d.ts","sourceRoot":"","sources":["../src/isPlainDateAfter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,KAAK,EAAE,QAAQ,CAAC,SAAS,GACxB,OAAO,CAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPlainDateAfter.test.d.ts","sourceRoot":"","sources":["../src/isPlainDateAfter.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the first plain date is before the second plain date.
|
|
4
|
+
* Compares calendar dates without time or timezone considerations.
|
|
5
|
+
*
|
|
6
|
+
* @param date1 - First plain date
|
|
7
|
+
* @param date2 - Second plain date
|
|
8
|
+
* @returns true if date1 is before date2, false otherwise
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const jan20 = Temporal.PlainDate.from('2025-01-20');
|
|
13
|
+
* const jan25 = Temporal.PlainDate.from('2025-01-25');
|
|
14
|
+
*
|
|
15
|
+
* isPlainDateBefore(jan20, jan25); // true
|
|
16
|
+
* isPlainDateBefore(jan25, jan20); // false
|
|
17
|
+
* isPlainDateBefore(jan20, jan20); // false
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function isPlainDateBefore(date1: Temporal.PlainDate, date2: Temporal.PlainDate): boolean;
|
|
21
|
+
//# sourceMappingURL=isPlainDateBefore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPlainDateBefore.d.ts","sourceRoot":"","sources":["../src/isPlainDateBefore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,KAAK,EAAE,QAAQ,CAAC,SAAS,GACxB,OAAO,CAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPlainDateBefore.test.d.ts","sourceRoot":"","sources":["../src/isPlainDateBefore.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the two plain dates are equal.
|
|
4
|
+
* Compares calendar dates without time or timezone considerations.
|
|
5
|
+
*
|
|
6
|
+
* @param date1 - First plain date
|
|
7
|
+
* @param date2 - Second plain date
|
|
8
|
+
* @returns true if date1 equals date2, false otherwise
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const jan20a = Temporal.PlainDate.from('2025-01-20');
|
|
13
|
+
* const jan20b = Temporal.PlainDate.from('2025-01-20');
|
|
14
|
+
* const jan25 = Temporal.PlainDate.from('2025-01-25');
|
|
15
|
+
*
|
|
16
|
+
* isPlainDateEqual(jan20a, jan20b); // true
|
|
17
|
+
* isPlainDateEqual(jan20a, jan25); // false
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function isPlainDateEqual(date1: Temporal.PlainDate, date2: Temporal.PlainDate): boolean;
|
|
21
|
+
//# sourceMappingURL=isPlainDateEqual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPlainDateEqual.d.ts","sourceRoot":"","sources":["../src/isPlainDateEqual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,KAAK,EAAE,QAAQ,CAAC,SAAS,GACxB,OAAO,CAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPlainDateEqual.test.d.ts","sourceRoot":"","sources":["../src/isPlainDateEqual.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED