generated from dave/wails-template
Rework the fuck of everything
This commit is contained in:
@@ -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 };
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user