From 3ca12139cd3d417d852785066cfabc9b8b9e0604 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Mon, 19 Aug 2024 14:34:47 +0200 Subject: [PATCH] Default display to last month Since we pay bills for the last month in the current month... --- frontend/src/lib/store/scrollingTimeFrameStore.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/store/scrollingTimeFrameStore.ts b/frontend/src/lib/store/scrollingTimeFrameStore.ts index f9d0b4e..3fb370a 100644 --- a/frontend/src/lib/store/scrollingTimeFrameStore.ts +++ b/frontend/src/lib/store/scrollingTimeFrameStore.ts @@ -4,7 +4,8 @@ import { type Writable, writable } from "svelte/store"; async function createStore(): Promise & { next: Function; prev: Function }> { const thism = new Date(); const lastm = new Date(); - lastm.setMonth(thism.getMonth() - 1); + thism.setMonth(thism.getMonth() - 1); + lastm.setMonth(lastm.getMonth() - 2); const { subscribe, update, set } = writable({ from: lastm, to: thism }); return {