Files
yara724-api/src/helpers/date-jalali.spec.ts
T
2026-09-12 14:23:23 +03:30

18 lines
502 B
TypeScript

import { toJalaliDateAndTime } from "./date-jalali";
describe("toJalaliDateAndTime", () => {
it("always formats timestamps in Asia/Tehran regardless of server timezone", () => {
expect(toJalaliDateAndTime("2026-08-10T12:30:45.000Z")).toEqual([
"1405/05/19",
"16:00",
]);
});
it("uses the Tehran calendar day when UTC and Tehran dates differ", () => {
expect(toJalaliDateAndTime("2026-08-10T21:30:00.000Z")).toEqual([
"1405/05/20",
"01:00",
]);
});
});