forked from Yara724/api
YARA-1258
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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",
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user