forked from Yara724/api
18 lines
502 B
TypeScript
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",
|
|
]);
|
|
});
|
|
});
|