2 Commits
1.0.0 ... 1.1.0

Author SHA1 Message Date
e83fb7abb8 Enable scroll through time with mousewheel 2024-08-19 14:40:24 +02:00
3ca12139cd Default display to last month
Since we pay bills for the last month in the current month...
2024-08-19 14:34:47 +02:00
2 changed files with 10 additions and 2 deletions

View File

@@ -18,9 +18,16 @@
scrollingTimeFrameStore.next(); scrollingTimeFrameStore.next();
} }
} }
function scroll(event: WheelEvent) {
if (event.deltaY < 0) {
scrollingTimeFrameStore.next();
} else {
scrollingTimeFrameStore.prev();
}
}
</script> </script>
<svelte:window on:keydown={keyDown} /> <svelte:window on:keydown={keyDown} on:wheel={scroll} />
<Toaster theme="dark" expand visibleToasts={9} /> <Toaster theme="dark" expand visibleToasts={9} />
<template> <template>
<!-- <Header /> --> <!-- <Header /> -->

View File

@@ -4,7 +4,8 @@ import { type Writable, writable } from "svelte/store";
async function createStore(): Promise<Writable<ScrollingTimeframe> & { next: Function; prev: Function }> { async function createStore(): Promise<Writable<ScrollingTimeframe> & { next: Function; prev: Function }> {
const thism = new Date(); const thism = new Date();
const lastm = 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 }); const { subscribe, update, set } = writable({ from: lastm, to: thism });
return { return {