fix(events): seven-date default period and picker from today (WealthLedger/frontend#63)
This commit is contained in:
@@ -38,11 +38,11 @@ describe("calendar dates", () => {
|
||||
expect(moscowDate(new Date("2026-12-31T21:00:00Z"))).toBe("2027-01-01");
|
||||
});
|
||||
|
||||
it("defaults to the last 7 days including today", () => {
|
||||
it("defaults to 7 calendar dates starting with today", () => {
|
||||
const [from, to] = defaultPeriod();
|
||||
|
||||
expect(calendarDate.safeParse(from).success).toBe(true);
|
||||
expect(to).toBe(moscowDate(new Date()));
|
||||
expect(from).toBe(moscowDate(new Date()));
|
||||
expect((Date.parse(to) - Date.parse(from)) / 86_400_000).toBe(6);
|
||||
expect(from <= to).toBe(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user