
























@@ -19,6 +19,11 @@ describe("parseOffsetlessIsoDateTimeInTimeZone", () => {
1919["2026-03-29T02:30:00", "Europe/Oslo", null],
2020["2026-03-23T23:00:00+02:00", "Europe/Oslo", null],
2121["2026-03-23T23:00:00", "Invalid/Timezone", null],
22+// Sub-second precision is accepted by the regex and must round-trip rather
23+// than being silently rejected (the offset must be computed at ms resolution).
24+["2026-03-23T23:00:00.250", "UTC", "2026-03-23T23:00:00.250Z"],
25+["2026-03-23T23:00:00.999", "UTC", "2026-03-23T23:00:00.999Z"],
26+["2026-03-23T23:00:00.123", "Europe/Oslo", "2026-03-23T22:00:00.123Z"],
2227])("parses zoned datetime %s in %s", (input, timezone, expected) => {
2328expect(parseOffsetlessIsoDateTimeInTimeZone(input, timezone)).toBe(expected);
2429});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。