@gobrand/tiempo 2.5.1 → 2.5.3
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/dist/chunk-AJEIDKVJ.js +10 -0
- package/dist/chunk-AJEIDKVJ.js.map +1 -0
- package/dist/chunk-G45S5B4O.js +25 -0
- package/dist/chunk-G45S5B4O.js.map +1 -0
- package/dist/chunk-RBEW6PXR.js +10 -0
- package/dist/chunk-RBEW6PXR.js.map +1 -0
- package/dist/chunk-UCCWUJ2K.js +25 -0
- package/dist/chunk-UCCWUJ2K.js.map +1 -0
- package/dist/chunk-VZJGCDAG.js +10 -0
- package/dist/chunk-VZJGCDAG.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -31
- package/dist/isPlainTimeAfter.d.ts +21 -0
- package/dist/isPlainTimeAfter.d.ts.map +1 -0
- package/dist/isPlainTimeAfter.js +7 -0
- package/dist/isPlainTimeAfter.js.map +1 -0
- package/dist/isPlainTimeAfter.test.d.ts +2 -0
- package/dist/isPlainTimeAfter.test.d.ts.map +1 -0
- package/dist/isPlainTimeBefore.d.ts +21 -0
- package/dist/isPlainTimeBefore.d.ts.map +1 -0
- package/dist/isPlainTimeBefore.js +7 -0
- package/dist/isPlainTimeBefore.js.map +1 -0
- package/dist/isPlainTimeBefore.test.d.ts +2 -0
- package/dist/isPlainTimeBefore.test.d.ts.map +1 -0
- package/dist/isPlainTimeEqual.d.ts +21 -0
- package/dist/isPlainTimeEqual.d.ts.map +1 -0
- package/dist/isPlainTimeEqual.js +7 -0
- package/dist/isPlainTimeEqual.js.map +1 -0
- package/dist/isPlainTimeEqual.test.d.ts +2 -0
- package/dist/isPlainTimeEqual.test.d.ts.map +1 -0
- package/dist/toPlainDate.d.ts +31 -0
- package/dist/toPlainDate.d.ts.map +1 -0
- package/dist/toPlainDate.js +7 -0
- package/dist/toPlainDate.js.map +1 -0
- package/dist/toPlainDate.test.d.ts +2 -0
- package/dist/toPlainDate.test.d.ts.map +1 -0
- package/dist/toPlainTime.d.ts +32 -0
- package/dist/toPlainTime.d.ts.map +1 -0
- package/dist/toPlainTime.js +7 -0
- package/dist/toPlainTime.js.map +1 -0
- package/dist/toPlainTime.test.d.ts +2 -0
- package/dist/toPlainTime.test.d.ts.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/isPlainTimeBefore.ts
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
function isPlainTimeBefore(time1, time2) {
|
|
4
|
+
return Temporal.PlainTime.compare(time1, time2) < 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
isPlainTimeBefore
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=chunk-AJEIDKVJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isPlainTimeBefore.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill';\n\n/**\n * Returns true if the first plain time is before the second plain time.\n * Compares wall-clock times without date or timezone considerations.\n *\n * @param time1 - First plain time\n * @param time2 - Second plain time\n * @returns true if time1 is before time2, false otherwise\n *\n * @example\n * ```ts\n * const morning = Temporal.PlainTime.from('09:00');\n * const evening = Temporal.PlainTime.from('17:00');\n *\n * isPlainTimeBefore(morning, evening); // true\n * isPlainTimeBefore(evening, morning); // false\n * isPlainTimeBefore(morning, morning); // false\n * ```\n */\nexport function isPlainTimeBefore(\n time1: Temporal.PlainTime,\n time2: Temporal.PlainTime\n): boolean {\n return Temporal.PlainTime.compare(time1, time2) < 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,25 @@
|
|
|
1
|
+
// src/toPlainTime.ts
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
function toPlainTime(input, timezone) {
|
|
4
|
+
if (input instanceof Temporal.ZonedDateTime && timezone === void 0) {
|
|
5
|
+
return input.toPlainTime();
|
|
6
|
+
}
|
|
7
|
+
if (timezone === void 0) {
|
|
8
|
+
throw new Error("Timezone is required unless input is a ZonedDateTime");
|
|
9
|
+
}
|
|
10
|
+
if (typeof input === "string") {
|
|
11
|
+
return Temporal.Instant.from(input).toZonedDateTimeISO(timezone).toPlainTime();
|
|
12
|
+
}
|
|
13
|
+
if (input instanceof Date) {
|
|
14
|
+
return Temporal.Instant.from(input.toISOString()).toZonedDateTimeISO(timezone).toPlainTime();
|
|
15
|
+
}
|
|
16
|
+
if (input instanceof Temporal.Instant) {
|
|
17
|
+
return input.toZonedDateTimeISO(timezone).toPlainTime();
|
|
18
|
+
}
|
|
19
|
+
return input.toInstant().toZonedDateTimeISO(timezone).toPlainTime();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
toPlainTime
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=chunk-G45S5B4O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/toPlainTime.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill';\nimport type { Timezone } from './types';\n\n/**\n * Extract the wall-clock time from a ZonedDateTime or convert an input to a timezone and extract the time.\n *\n * @param input - A Temporal.ZonedDateTime (timezone optional) or a UTC ISO string, Date, Instant, or ZonedDateTime (timezone required)\n * @param timezone - IANA timezone identifier. Required unless input is a ZonedDateTime.\n * @returns A Temporal.PlainTime representing the wall-clock time\n *\n * @example\n * ```typescript\n * import { toPlainTime, toZonedTime } from '@gobrand/tiempo';\n *\n * // From ZonedDateTime (no timezone needed)\n * const zdt = toZonedTime(\"2025-01-20T15:30:00Z\", \"America/New_York\");\n * const time = toPlainTime(zdt); // 10:30\n *\n * // From UTC string with timezone\n * const time2 = toPlainTime(\"2025-01-20T15:30:00Z\", \"America/New_York\"); // 10:30\n *\n * // From Date with timezone\n * const date = new Date(\"2025-01-20T15:30:00.000Z\");\n * const time3 = toPlainTime(date, \"Europe/London\"); // 15:30\n *\n * // From Instant with timezone\n * const instant = Temporal.Instant.from(\"2025-01-20T15:30:00Z\");\n * const time4 = toPlainTime(instant, \"Asia/Tokyo\"); // 00:30\n * ```\n */\nexport function toPlainTime(input: Temporal.ZonedDateTime): Temporal.PlainTime;\nexport function toPlainTime(\n input: string | Date | Temporal.Instant | Temporal.ZonedDateTime,\n timezone: Timezone\n): Temporal.PlainTime;\nexport function toPlainTime(\n input: string | Date | Temporal.Instant | Temporal.ZonedDateTime,\n timezone?: Timezone\n): Temporal.PlainTime {\n if (input instanceof Temporal.ZonedDateTime && timezone === undefined) {\n return input.toPlainTime();\n }\n\n if (timezone === undefined) {\n throw new Error('Timezone is required unless input is a ZonedDateTime');\n }\n\n if (typeof input === 'string') {\n return Temporal.Instant.from(input).toZonedDateTimeISO(timezone).toPlainTime();\n }\n\n if (input instanceof Date) {\n return Temporal.Instant.from(input.toISOString()).toZonedDateTimeISO(timezone).toPlainTime();\n }\n\n if (input instanceof Temporal.Instant) {\n return input.toZonedDateTimeISO(timezone).toPlainTime();\n }\n\n return input.toInstant().toZonedDateTimeISO(timezone).toPlainTime();\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AAmClB,SAAS,YACd,OACA,UACoB;AACpB,MAAI,iBAAiB,SAAS,iBAAiB,aAAa,QAAW;AACrE,WAAO,MAAM,YAAY;AAAA,EAC3B;AAEA,MAAI,aAAa,QAAW;AAC1B,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACxE;AAEA,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,SAAS,QAAQ,KAAK,KAAK,EAAE,mBAAmB,QAAQ,EAAE,YAAY;AAAA,EAC/E;AAEA,MAAI,iBAAiB,MAAM;AACzB,WAAO,SAAS,QAAQ,KAAK,MAAM,YAAY,CAAC,EAAE,mBAAmB,QAAQ,EAAE,YAAY;AAAA,EAC7F;AAEA,MAAI,iBAAiB,SAAS,SAAS;AACrC,WAAO,MAAM,mBAAmB,QAAQ,EAAE,YAAY;AAAA,EACxD;AAEA,SAAO,MAAM,UAAU,EAAE,mBAAmB,QAAQ,EAAE,YAAY;AACpE;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/isPlainTimeAfter.ts
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
function isPlainTimeAfter(time1, time2) {
|
|
4
|
+
return Temporal.PlainTime.compare(time1, time2) > 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
isPlainTimeAfter
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=chunk-RBEW6PXR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isPlainTimeAfter.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill';\n\n/**\n * Returns true if the first plain time is after the second plain time.\n * Compares wall-clock times without date or timezone considerations.\n *\n * @param time1 - First plain time\n * @param time2 - Second plain time\n * @returns true if time1 is after time2, false otherwise\n *\n * @example\n * ```ts\n * const morning = Temporal.PlainTime.from('09:00');\n * const evening = Temporal.PlainTime.from('17:00');\n *\n * isPlainTimeAfter(evening, morning); // true\n * isPlainTimeAfter(morning, evening); // false\n * isPlainTimeAfter(morning, morning); // false\n * ```\n */\nexport function isPlainTimeAfter(\n time1: Temporal.PlainTime,\n time2: Temporal.PlainTime\n): boolean {\n return Temporal.PlainTime.compare(time1, time2) > 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,25 @@
|
|
|
1
|
+
// src/toPlainDate.ts
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
function toPlainDate(input, timezone) {
|
|
4
|
+
if (input instanceof Temporal.ZonedDateTime && timezone === void 0) {
|
|
5
|
+
return input.toPlainDate();
|
|
6
|
+
}
|
|
7
|
+
if (timezone === void 0) {
|
|
8
|
+
throw new Error("Timezone is required unless input is a ZonedDateTime");
|
|
9
|
+
}
|
|
10
|
+
if (typeof input === "string") {
|
|
11
|
+
return Temporal.Instant.from(input).toZonedDateTimeISO(timezone).toPlainDate();
|
|
12
|
+
}
|
|
13
|
+
if (input instanceof Date) {
|
|
14
|
+
return Temporal.Instant.from(input.toISOString()).toZonedDateTimeISO(timezone).toPlainDate();
|
|
15
|
+
}
|
|
16
|
+
if (input instanceof Temporal.Instant) {
|
|
17
|
+
return input.toZonedDateTimeISO(timezone).toPlainDate();
|
|
18
|
+
}
|
|
19
|
+
return input.toInstant().toZonedDateTimeISO(timezone).toPlainDate();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
toPlainDate
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=chunk-UCCWUJ2K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/toPlainDate.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill';\nimport type { Timezone } from './types';\n\n/**\n * Extract the calendar date from a ZonedDateTime or convert an input to a timezone and extract the date.\n *\n * @param input - A Temporal.ZonedDateTime (timezone optional) or a UTC ISO string, Date, Instant, or ZonedDateTime (timezone required)\n * @param timezone - IANA timezone identifier. Required unless input is a ZonedDateTime.\n * @returns A Temporal.PlainDate representing the calendar date\n *\n * @example\n * ```typescript\n * import { toPlainDate, toZonedTime } from '@gobrand/tiempo';\n *\n * // From ZonedDateTime (no timezone needed)\n * const zdt = toZonedTime(\"2025-01-20T15:30:00Z\", \"America/New_York\");\n * const date = toPlainDate(zdt); // 2025-01-20\n *\n * // From UTC string with timezone\n * const date2 = toPlainDate(\"2025-01-20T15:30:00Z\", \"America/New_York\"); // 2025-01-20\n *\n * // From Date with timezone\n * const jsDate = new Date(\"2025-01-20T15:30:00.000Z\");\n * const date3 = toPlainDate(jsDate, \"Europe/London\"); // 2025-01-20\n *\n * // Date boundary crossing: 23:00 UTC on Jan 20 → Jan 21 in Tokyo\n * const date4 = toPlainDate(\"2025-01-20T23:00:00Z\", \"Asia/Tokyo\"); // 2025-01-21\n * ```\n */\nexport function toPlainDate(input: Temporal.ZonedDateTime): Temporal.PlainDate;\nexport function toPlainDate(\n input: string | Date | Temporal.Instant | Temporal.ZonedDateTime,\n timezone: Timezone\n): Temporal.PlainDate;\nexport function toPlainDate(\n input: string | Date | Temporal.Instant | Temporal.ZonedDateTime,\n timezone?: Timezone\n): Temporal.PlainDate {\n if (input instanceof Temporal.ZonedDateTime && timezone === undefined) {\n return input.toPlainDate();\n }\n\n if (timezone === undefined) {\n throw new Error('Timezone is required unless input is a ZonedDateTime');\n }\n\n if (typeof input === 'string') {\n return Temporal.Instant.from(input).toZonedDateTimeISO(timezone).toPlainDate();\n }\n\n if (input instanceof Date) {\n return Temporal.Instant.from(input.toISOString()).toZonedDateTimeISO(timezone).toPlainDate();\n }\n\n if (input instanceof Temporal.Instant) {\n return input.toZonedDateTimeISO(timezone).toPlainDate();\n }\n\n return input.toInstant().toZonedDateTimeISO(timezone).toPlainDate();\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AAkClB,SAAS,YACd,OACA,UACoB;AACpB,MAAI,iBAAiB,SAAS,iBAAiB,aAAa,QAAW;AACrE,WAAO,MAAM,YAAY;AAAA,EAC3B;AAEA,MAAI,aAAa,QAAW;AAC1B,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACxE;AAEA,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,SAAS,QAAQ,KAAK,KAAK,EAAE,mBAAmB,QAAQ,EAAE,YAAY;AAAA,EAC/E;AAEA,MAAI,iBAAiB,MAAM;AACzB,WAAO,SAAS,QAAQ,KAAK,MAAM,YAAY,CAAC,EAAE,mBAAmB,QAAQ,EAAE,YAAY;AAAA,EAC7F;AAEA,MAAI,iBAAiB,SAAS,SAAS;AACrC,WAAO,MAAM,mBAAmB,QAAQ,EAAE,YAAY;AAAA,EACxD;AAEA,SAAO,MAAM,UAAU,EAAE,mBAAmB,QAAQ,EAAE,YAAY;AACpE;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/isPlainTimeEqual.ts
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
function isPlainTimeEqual(time1, time2) {
|
|
4
|
+
return Temporal.PlainTime.compare(time1, time2) === 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
isPlainTimeEqual
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=chunk-VZJGCDAG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isPlainTimeEqual.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill';\n\n/**\n * Returns true if the two plain times are equal.\n * Compares wall-clock times without date or timezone considerations.\n *\n * @param time1 - First plain time\n * @param time2 - Second plain time\n * @returns true if time1 equals time2, false otherwise\n *\n * @example\n * ```ts\n * const nineAM_a = Temporal.PlainTime.from('09:00');\n * const nineAM_b = Temporal.PlainTime.from('09:00');\n * const fivePM = Temporal.PlainTime.from('17:00');\n *\n * isPlainTimeEqual(nineAM_a, nineAM_b); // true\n * isPlainTimeEqual(nineAM_a, fivePM); // false\n * ```\n */\nexport function isPlainTimeEqual(\n time1: Temporal.PlainTime,\n time2: Temporal.PlainTime\n): boolean {\n return Temporal.PlainTime.compare(time1, time2) === 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
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { toZonedTime } from './toZonedTime';
|
|
2
|
+
export { toPlainTime } from './toPlainTime';
|
|
3
|
+
export { toPlainDate } from './toPlainDate';
|
|
2
4
|
export type { Timezone, IANATimezone } from './types';
|
|
3
5
|
export { browserTimezone } from './browserTimezone';
|
|
4
6
|
export { toUtc } from './toUtc';
|
|
@@ -66,4 +68,7 @@ export { intlFormatDistance, type IntlFormatDistanceOptions, } from './intlForma
|
|
|
66
68
|
export { isPlainDateBefore } from './isPlainDateBefore';
|
|
67
69
|
export { isPlainDateAfter } from './isPlainDateAfter';
|
|
68
70
|
export { isPlainDateEqual } from './isPlainDateEqual';
|
|
71
|
+
export { isPlainTimeBefore } from './isPlainTimeBefore';
|
|
72
|
+
export { isPlainTimeAfter } from './isPlainTimeAfter';
|
|
73
|
+
export { isPlainTimeEqual } from './isPlainTimeEqual';
|
|
69
74
|
//# 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,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EACL,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO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,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,KAAK,yBAAyB,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toZonedTime
|
|
3
|
+
} from "./chunk-MXQFENCR.js";
|
|
4
|
+
import {
|
|
5
|
+
today
|
|
6
|
+
} from "./chunk-KZB6NERH.js";
|
|
7
|
+
import {
|
|
8
|
+
subYears
|
|
9
|
+
} from "./chunk-AHMKY474.js";
|
|
10
|
+
import {
|
|
11
|
+
toDate
|
|
12
|
+
} from "./chunk-TGKWBQ7L.js";
|
|
1
13
|
import {
|
|
2
14
|
toIso
|
|
3
15
|
} from "./chunk-BSV32PSO.js";
|
|
4
16
|
import {
|
|
5
17
|
toIso9075
|
|
6
18
|
} from "./chunk-DFLGGK4F.js";
|
|
19
|
+
import {
|
|
20
|
+
toPlainDate
|
|
21
|
+
} from "./chunk-UCCWUJ2K.js";
|
|
22
|
+
import {
|
|
23
|
+
toPlainTime
|
|
24
|
+
} from "./chunk-G45S5B4O.js";
|
|
7
25
|
import {
|
|
8
26
|
toUtc
|
|
9
27
|
} from "./chunk-BW5SFCKS.js";
|
|
10
28
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
29
|
+
subHours
|
|
30
|
+
} from "./chunk-XW5MLXX5.js";
|
|
13
31
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./chunk-
|
|
32
|
+
subMicroseconds
|
|
33
|
+
} from "./chunk-BQBLSXK2.js";
|
|
34
|
+
import {
|
|
35
|
+
subMilliseconds
|
|
36
|
+
} from "./chunk-HDBH7RTY.js";
|
|
16
37
|
import {
|
|
17
38
|
subMinutes
|
|
18
39
|
} from "./chunk-J6G2I2TU.js";
|
|
@@ -29,11 +50,14 @@ import {
|
|
|
29
50
|
subWeeks
|
|
30
51
|
} from "./chunk-U4RNUZXO.js";
|
|
31
52
|
import {
|
|
32
|
-
|
|
33
|
-
} from "./chunk-
|
|
53
|
+
isSameYear
|
|
54
|
+
} from "./chunk-VLZ3HQQA.js";
|
|
34
55
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./chunk-
|
|
56
|
+
now
|
|
57
|
+
} from "./chunk-FSD3DDFC.js";
|
|
58
|
+
import {
|
|
59
|
+
simpleFormat
|
|
60
|
+
} from "./chunk-TFSZ55L7.js";
|
|
37
61
|
import {
|
|
38
62
|
startOfDay
|
|
39
63
|
} from "./chunk-TW5EV3DH.js";
|
|
@@ -50,14 +74,14 @@ import {
|
|
|
50
74
|
subDays
|
|
51
75
|
} from "./chunk-YKBP3G7L.js";
|
|
52
76
|
import {
|
|
53
|
-
|
|
54
|
-
} from "./chunk-
|
|
77
|
+
isSameHour
|
|
78
|
+
} from "./chunk-EEQ3REET.js";
|
|
55
79
|
import {
|
|
56
|
-
|
|
57
|
-
} from "./chunk-
|
|
80
|
+
isSameMicrosecond
|
|
81
|
+
} from "./chunk-PPB62JYV.js";
|
|
58
82
|
import {
|
|
59
|
-
|
|
60
|
-
} from "./chunk-
|
|
83
|
+
isSameMillisecond
|
|
84
|
+
} from "./chunk-ISHZRFVN.js";
|
|
61
85
|
import {
|
|
62
86
|
isSameMinute
|
|
63
87
|
} from "./chunk-LDO6PRNJ.js";
|
|
@@ -73,15 +97,6 @@ import {
|
|
|
73
97
|
import {
|
|
74
98
|
isSameWeek
|
|
75
99
|
} from "./chunk-JOD4ATPE.js";
|
|
76
|
-
import {
|
|
77
|
-
isSameYear
|
|
78
|
-
} from "./chunk-VLZ3HQQA.js";
|
|
79
|
-
import {
|
|
80
|
-
now
|
|
81
|
-
} from "./chunk-FSD3DDFC.js";
|
|
82
|
-
import {
|
|
83
|
-
simpleFormat
|
|
84
|
-
} from "./chunk-TFSZ55L7.js";
|
|
85
100
|
import {
|
|
86
101
|
isPast
|
|
87
102
|
} from "./chunk-2H4KLXGL.js";
|
|
@@ -95,17 +110,17 @@ import {
|
|
|
95
110
|
isPlainDateEqual
|
|
96
111
|
} from "./chunk-O6RIN7K3.js";
|
|
97
112
|
import {
|
|
98
|
-
|
|
99
|
-
} from "./chunk-
|
|
113
|
+
isPlainTimeAfter
|
|
114
|
+
} from "./chunk-RBEW6PXR.js";
|
|
100
115
|
import {
|
|
101
|
-
|
|
102
|
-
} from "./chunk-
|
|
116
|
+
isPlainTimeBefore
|
|
117
|
+
} from "./chunk-AJEIDKVJ.js";
|
|
103
118
|
import {
|
|
104
|
-
|
|
105
|
-
} from "./chunk-
|
|
119
|
+
isPlainTimeEqual
|
|
120
|
+
} from "./chunk-VZJGCDAG.js";
|
|
106
121
|
import {
|
|
107
|
-
|
|
108
|
-
} from "./chunk-
|
|
122
|
+
isSameDay
|
|
123
|
+
} from "./chunk-RW3C2677.js";
|
|
109
124
|
import {
|
|
110
125
|
endOfYear
|
|
111
126
|
} from "./chunk-XDVUGTUV.js";
|
|
@@ -237,6 +252,9 @@ export {
|
|
|
237
252
|
isPlainDateAfter,
|
|
238
253
|
isPlainDateBefore,
|
|
239
254
|
isPlainDateEqual,
|
|
255
|
+
isPlainTimeAfter,
|
|
256
|
+
isPlainTimeBefore,
|
|
257
|
+
isPlainTimeEqual,
|
|
240
258
|
isSameDay,
|
|
241
259
|
isSameHour,
|
|
242
260
|
isSameMicrosecond,
|
|
@@ -266,6 +284,8 @@ export {
|
|
|
266
284
|
toDate,
|
|
267
285
|
toIso,
|
|
268
286
|
toIso9075,
|
|
287
|
+
toPlainDate,
|
|
288
|
+
toPlainTime,
|
|
269
289
|
toUtc,
|
|
270
290
|
toZonedTime,
|
|
271
291
|
today
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the first plain time is after the second plain time.
|
|
4
|
+
* Compares wall-clock times without date or timezone considerations.
|
|
5
|
+
*
|
|
6
|
+
* @param time1 - First plain time
|
|
7
|
+
* @param time2 - Second plain time
|
|
8
|
+
* @returns true if time1 is after time2, false otherwise
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const morning = Temporal.PlainTime.from('09:00');
|
|
13
|
+
* const evening = Temporal.PlainTime.from('17:00');
|
|
14
|
+
*
|
|
15
|
+
* isPlainTimeAfter(evening, morning); // true
|
|
16
|
+
* isPlainTimeAfter(morning, evening); // false
|
|
17
|
+
* isPlainTimeAfter(morning, morning); // false
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function isPlainTimeAfter(time1: Temporal.PlainTime, time2: Temporal.PlainTime): boolean;
|
|
21
|
+
//# sourceMappingURL=isPlainTimeAfter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPlainTimeAfter.d.ts","sourceRoot":"","sources":["../src/isPlainTimeAfter.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":"isPlainTimeAfter.test.d.ts","sourceRoot":"","sources":["../src/isPlainTimeAfter.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the first plain time is before the second plain time.
|
|
4
|
+
* Compares wall-clock times without date or timezone considerations.
|
|
5
|
+
*
|
|
6
|
+
* @param time1 - First plain time
|
|
7
|
+
* @param time2 - Second plain time
|
|
8
|
+
* @returns true if time1 is before time2, false otherwise
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const morning = Temporal.PlainTime.from('09:00');
|
|
13
|
+
* const evening = Temporal.PlainTime.from('17:00');
|
|
14
|
+
*
|
|
15
|
+
* isPlainTimeBefore(morning, evening); // true
|
|
16
|
+
* isPlainTimeBefore(evening, morning); // false
|
|
17
|
+
* isPlainTimeBefore(morning, morning); // false
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function isPlainTimeBefore(time1: Temporal.PlainTime, time2: Temporal.PlainTime): boolean;
|
|
21
|
+
//# sourceMappingURL=isPlainTimeBefore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPlainTimeBefore.d.ts","sourceRoot":"","sources":["../src/isPlainTimeBefore.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":"isPlainTimeBefore.test.d.ts","sourceRoot":"","sources":["../src/isPlainTimeBefore.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the two plain times are equal.
|
|
4
|
+
* Compares wall-clock times without date or timezone considerations.
|
|
5
|
+
*
|
|
6
|
+
* @param time1 - First plain time
|
|
7
|
+
* @param time2 - Second plain time
|
|
8
|
+
* @returns true if time1 equals time2, false otherwise
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const nineAM_a = Temporal.PlainTime.from('09:00');
|
|
13
|
+
* const nineAM_b = Temporal.PlainTime.from('09:00');
|
|
14
|
+
* const fivePM = Temporal.PlainTime.from('17:00');
|
|
15
|
+
*
|
|
16
|
+
* isPlainTimeEqual(nineAM_a, nineAM_b); // true
|
|
17
|
+
* isPlainTimeEqual(nineAM_a, fivePM); // false
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function isPlainTimeEqual(time1: Temporal.PlainTime, time2: Temporal.PlainTime): boolean;
|
|
21
|
+
//# sourceMappingURL=isPlainTimeEqual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPlainTimeEqual.d.ts","sourceRoot":"","sources":["../src/isPlainTimeEqual.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":"isPlainTimeEqual.test.d.ts","sourceRoot":"","sources":["../src/isPlainTimeEqual.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
import type { Timezone } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Extract the calendar date from a ZonedDateTime or convert an input to a timezone and extract the date.
|
|
5
|
+
*
|
|
6
|
+
* @param input - A Temporal.ZonedDateTime (timezone optional) or a UTC ISO string, Date, Instant, or ZonedDateTime (timezone required)
|
|
7
|
+
* @param timezone - IANA timezone identifier. Required unless input is a ZonedDateTime.
|
|
8
|
+
* @returns A Temporal.PlainDate representing the calendar date
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { toPlainDate, toZonedTime } from '@gobrand/tiempo';
|
|
13
|
+
*
|
|
14
|
+
* // From ZonedDateTime (no timezone needed)
|
|
15
|
+
* const zdt = toZonedTime("2025-01-20T15:30:00Z", "America/New_York");
|
|
16
|
+
* const date = toPlainDate(zdt); // 2025-01-20
|
|
17
|
+
*
|
|
18
|
+
* // From UTC string with timezone
|
|
19
|
+
* const date2 = toPlainDate("2025-01-20T15:30:00Z", "America/New_York"); // 2025-01-20
|
|
20
|
+
*
|
|
21
|
+
* // From Date with timezone
|
|
22
|
+
* const jsDate = new Date("2025-01-20T15:30:00.000Z");
|
|
23
|
+
* const date3 = toPlainDate(jsDate, "Europe/London"); // 2025-01-20
|
|
24
|
+
*
|
|
25
|
+
* // Date boundary crossing: 23:00 UTC on Jan 20 → Jan 21 in Tokyo
|
|
26
|
+
* const date4 = toPlainDate("2025-01-20T23:00:00Z", "Asia/Tokyo"); // 2025-01-21
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function toPlainDate(input: Temporal.ZonedDateTime): Temporal.PlainDate;
|
|
30
|
+
export declare function toPlainDate(input: string | Date | Temporal.Instant | Temporal.ZonedDateTime, timezone: Timezone): Temporal.PlainDate;
|
|
31
|
+
//# sourceMappingURL=toPlainDate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toPlainDate.d.ts","sourceRoot":"","sources":["../src/toPlainDate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC/E,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChE,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toPlainDate.test.d.ts","sourceRoot":"","sources":["../src/toPlainDate.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
import type { Timezone } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Extract the wall-clock time from a ZonedDateTime or convert an input to a timezone and extract the time.
|
|
5
|
+
*
|
|
6
|
+
* @param input - A Temporal.ZonedDateTime (timezone optional) or a UTC ISO string, Date, Instant, or ZonedDateTime (timezone required)
|
|
7
|
+
* @param timezone - IANA timezone identifier. Required unless input is a ZonedDateTime.
|
|
8
|
+
* @returns A Temporal.PlainTime representing the wall-clock time
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { toPlainTime, toZonedTime } from '@gobrand/tiempo';
|
|
13
|
+
*
|
|
14
|
+
* // From ZonedDateTime (no timezone needed)
|
|
15
|
+
* const zdt = toZonedTime("2025-01-20T15:30:00Z", "America/New_York");
|
|
16
|
+
* const time = toPlainTime(zdt); // 10:30
|
|
17
|
+
*
|
|
18
|
+
* // From UTC string with timezone
|
|
19
|
+
* const time2 = toPlainTime("2025-01-20T15:30:00Z", "America/New_York"); // 10:30
|
|
20
|
+
*
|
|
21
|
+
* // From Date with timezone
|
|
22
|
+
* const date = new Date("2025-01-20T15:30:00.000Z");
|
|
23
|
+
* const time3 = toPlainTime(date, "Europe/London"); // 15:30
|
|
24
|
+
*
|
|
25
|
+
* // From Instant with timezone
|
|
26
|
+
* const instant = Temporal.Instant.from("2025-01-20T15:30:00Z");
|
|
27
|
+
* const time4 = toPlainTime(instant, "Asia/Tokyo"); // 00:30
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function toPlainTime(input: Temporal.ZonedDateTime): Temporal.PlainTime;
|
|
31
|
+
export declare function toPlainTime(input: string | Date | Temporal.Instant | Temporal.ZonedDateTime, timezone: Timezone): Temporal.PlainTime;
|
|
32
|
+
//# sourceMappingURL=toPlainTime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toPlainTime.d.ts","sourceRoot":"","sources":["../src/toPlainTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC/E,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChE,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toPlainTime.test.d.ts","sourceRoot":"","sources":["../src/toPlainTime.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gobrand/tiempo",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "Lightweight utility functions for converting between UTC and timezone-aware datetimes using the Temporal API",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"homepage": "https://eng.gobrand.app/tiempo",
|
|
32
32
|
"scripts": {
|
|
33
33
|
"generate:timezones": "tsx scripts/generate-timezone-types.ts",
|
|
34
|
-
"
|
|
34
|
+
"generate:docs": "tsx scripts/generate-docs.ts",
|
|
35
|
+
"build": "pnpm generate:timezones && pnpm generate:docs && tsup && tsc --emitDeclarationOnly",
|
|
35
36
|
"clean": "git clean -xdf .cache .turbo dist node_modules tsconfig.tsbuildinfo",
|
|
36
37
|
"test": "vitest",
|
|
37
38
|
"typecheck": "tsc --noEmit",
|