Found a bug? Please fill out the sections below. ð
Issue Summary
parseDateTimeWithTimeZone in packages/lib/parse-dates.ts writes to two module-level option objects (timeOptions, dateOptions) on every call, including timeOptions.hourCycle and delete timeOptions.hour12. Those changes are never reset, so a call that asks for a 24-hour format changes the result of later calls that pass no time-format option. The output of a call depends on which calls ran before it in the same process.
Steps to Reproduce
I copied the logic of the function into a Node script (so no database or app is needed) and called it four times with the same date:
const date = new Date("2026-11-04T14:30:00Z");
parseDateTimeWithTimeZone(date, "en", "UTC"); // 1
parseDateTimeWithTimeZone(date, "en", "UTC", { selectedTimeFormat: TimeFormat.TWENTY_FOUR_HOUR }); // 2
parseDateTimeWithTimeZone(date, "en", "UTC"); // 3 same input as 1
parseDateTimeWithTimeZone(date, "en", "UTC", { selectedTimeFormat: TimeFormat.TWELVE_HOUR }); // 4
Actual Results
1) 2:30pm, Wednesday, November 4, 2026
2) 14:30, Wednesday, November 4, 2026
3) 14:30, Wednesday, November 4, 2026 <- same input as 1, but now 24-hour
4) 2:30pm, Wednesday, November 4, 2026
Expected Results
Call 3 returns like call 1. A call's result should depend only on its own arguments.