generated from dave/wails-template
Fix scrolling in frame
This commit is contained in:
@@ -6,7 +6,7 @@ async function createStore(): Promise<Writable<ScrollingTimeframe> & { next: Fun
|
|||||||
const lastm = new Date();
|
const lastm = new Date();
|
||||||
lastm.setMonth(thism.getMonth() - 1);
|
lastm.setMonth(thism.getMonth() - 1);
|
||||||
|
|
||||||
const { subscribe, update, set } = writable({ from: thism, to: lastm });
|
const { subscribe, update, set } = writable({ from: lastm, to: thism });
|
||||||
return {
|
return {
|
||||||
subscribe,
|
subscribe,
|
||||||
update,
|
update,
|
||||||
@@ -14,14 +14,14 @@ async function createStore(): Promise<Writable<ScrollingTimeframe> & { next: Fun
|
|||||||
next: () => {
|
next: () => {
|
||||||
update((frame: ScrollingTimeframe) => {
|
update((frame: ScrollingTimeframe) => {
|
||||||
frame.from.setMonth(frame.from.getMonth() + 1);
|
frame.from.setMonth(frame.from.getMonth() + 1);
|
||||||
frame.to.setMonth(frame.from.getMonth() + 1);
|
frame.to.setMonth(frame.to.getMonth() + 1);
|
||||||
return frame;
|
return frame;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
prev: () => {
|
prev: () => {
|
||||||
update((frame: ScrollingTimeframe) => {
|
update((frame: ScrollingTimeframe) => {
|
||||||
frame.from.setMonth(frame.from.getMonth() - 1);
|
frame.from.setMonth(frame.from.getMonth() - 1);
|
||||||
frame.to.setMonth(frame.from.getMonth() - 1);
|
frame.to.setMonth(frame.to.getMonth() - 1);
|
||||||
return frame;
|
return frame;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user