fix: show snapshot time in browser time zone (#101)
This commit was merged in pull request #102.
This commit is contained in:
@@ -12,9 +12,16 @@ describe("shared display helpers", () => {
|
||||
expect(formatDate("2027-09-10")).toBe("10.09.2027");
|
||||
expect(formatDate("2024-02-29")).toBe("29.02.2024");
|
||||
expect(formatDate("2027-09-10T00:30:00+03:00")).toBe("09.09.2027");
|
||||
expect(formatSnapshotTime("2027-09-10T00:30:00+03:00")).toBe(
|
||||
"09.09.2027, 21:30",
|
||||
);
|
||||
});
|
||||
it("formats snapshot time in the browser time zone", () => {
|
||||
const instant = "2027-09-10T00:30:00+03:00";
|
||||
|
||||
const expected = new Intl.DateTimeFormat("ru-RU", {
|
||||
dateStyle: "short",
|
||||
timeStyle: "short",
|
||||
}).format(new Date(instant));
|
||||
|
||||
expect(formatSnapshotTime(instant)).toBe(expected);
|
||||
});
|
||||
it("formats decimal strings without financial arithmetic", () => {
|
||||
expect(formatMoney({ currency: "RUB", value: "-1234567.89" })).toBe(
|
||||
|
||||
Reference in New Issue
Block a user