Rework the fuck of everything

This commit is contained in:
2025-10-19 15:17:36 +02:00
parent 123b2961a2
commit e016dd7851
19 changed files with 762 additions and 155 deletions

View File

@@ -16,16 +16,20 @@ async function createStore(): Promise<Writable<ScrollingTimeframe> & { next: Fun
set,
next: () => {
update((frame: ScrollingTimeframe) => {
frame.from.setMonth(frame.from.getMonth() + 1);
frame.to.setMonth(frame.to.getMonth() + 1);
return frame;
const newFrom = new Date(frame.from);
const newTo = new Date(frame.to);
newFrom.setMonth(newFrom.getMonth() + 1);
newTo.setMonth(newTo.getMonth() + 1);
return { from: newFrom, to: newTo };
});
},
prev: () => {
update((frame: ScrollingTimeframe) => {
frame.from.setMonth(frame.from.getMonth() - 1);
frame.to.setMonth(frame.to.getMonth() - 1);
return frame;
const newFrom = new Date(frame.from);
const newTo = new Date(frame.to);
newFrom.setMonth(newFrom.getMonth() - 1);
newTo.setMonth(newTo.getMonth() - 1);
return { from: newFrom, to: newTo };
});
},
};