From b173886a1aec56219d5ffd2739421ec771bcd244 Mon Sep 17 00:00:00 2001 From: jahidem Date: Mon, 26 Dec 2022 12:16:31 +0600 Subject: [PATCH] fixed period selector based on #1 --- core/homeWindow.ts | 16 +++---- core/prisma/sqlite.db | Bin 53248 -> 53248 bytes src/screen/components/Setting.tsx | 69 +++++++++++++++++------------- 3 files changed, 47 insertions(+), 38 deletions(-) diff --git a/core/homeWindow.ts b/core/homeWindow.ts index dd31f87..84482d0 100644 --- a/core/homeWindow.ts +++ b/core/homeWindow.ts @@ -33,10 +33,10 @@ export default class HomeWindow { }, }); if (HomeWindow.thisWindow != null) { - HomeWindow.thisWindow.loadURL( - 'file://' + __dirname + '/../index.html#/home' - ); - // HomeWindow.thisWindow.loadURL("http://localhost:3000/#/home"); + // HomeWindow.thisWindow.loadURL( + // 'file://' + __dirname + '/../index.html#/home' + // ); + HomeWindow.thisWindow.loadURL("http://localhost:3000/#/home"); HomeWindow.thisWindow.on("closed", HomeWindow.onClose); } @@ -86,8 +86,8 @@ export default class HomeWindow { }); if (HomeWindow.logWindow != null) { - HomeWindow.logWindow.loadURL('file://' + __dirname + '/../index.html#/log'); - // HomeWindow.logWindow.loadURL("http://localhost:3000/#/log"); + // HomeWindow.logWindow.loadURL('file://' + __dirname + '/../index.html#/log'); + HomeWindow.logWindow.loadURL("http://localhost:3000/#/log"); } } @@ -137,8 +137,8 @@ export default class HomeWindow { ]; const menu = Menu.buildFromTemplate(template); Menu.setApplicationMenu(menu); - HomeWindow.potmWindow.loadURL('file://' + __dirname + '/../index.html#/potm'); - // HomeWindow.potmWindow.loadURL("http://localhost:3000/#/potm"); + // HomeWindow.potmWindow.loadURL('file://' + __dirname + '/../index.html#/potm'); + HomeWindow.potmWindow.loadURL("http://localhost:3000/#/potm"); // HomeWindow.potmWindow.on("closed", HomeWindow.closePotmWindow); } } diff --git a/core/prisma/sqlite.db b/core/prisma/sqlite.db index f65fe038ad16dea134501bba256b9116ad664fab..b5ca5b1887282291fb28932fc31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rgJax(6pj)~5P$&pABW?#UMPV* zut#wau@348L!lOG2_@JKyE(BQ>N&PRi;_zIW@sjqU;}L6_Eu=6cc+UTk~yJ+hIEip|B0M5lT=D#XRsX*rhxYmasD> zbnvr%M1klf*hsh#5aUAezCGKLu2yZvyt=~ zQ+BY6_1}!YQL{?x=Pz97Tw_>z63K#jzG#DKkjZ^sS+3?H2 zGi^3zun*qUYO8+?o^FoBvmP@hdC2)x@bb~J`-mC)s}t1Dnk_VuWAV$D@bJv(ef`e) zOXd%z)wQehSi!;7nGO-}9iF4nwTst>Mu<``l=9|iYGAF~j?;5K!}oISl=NFX=?t$K zU&&8XJN=*C>NOsn2=lrFW;bECe_tlTw$Hba#EXR1eW9qY365=u!{4#tb$68a&VvVyqtb^^w zWv-4L@e)}5CY~)e&&*>uAtB8=#Mytwd#Zf;B3wQnf zug}#+ehZtnue+fL7L-_ds!#>RDAM<>S(gDV_VaDCx zJs*SpQ>e~(R%e*&)5-s|KVH`Ti*|d$P=w4e+DF56(j79e74gFay?aCoBIFN#*r*e0 zzR%7i+&(Sw89gD+bu)$M3_dE*g*u5IE!hO+obs-+SW%fSm>NuJrqRX=#s*`SF+#p8 z2jn7oo-7-#843&&_5J!2`XB03^hVujU8QchZoG6&Iw-A^Y{BTz`&#t3eNLaeU*JzG zHsYifd+@teFN*lHYA^f8pzMEuZ?5%XgRd7GcDwNx!e7XtRH>LX_#Zpk(Avs}+_B<3z;YyuyuCp#7g#HA> zpX)DYd2vg78vhVK*OI1{9|~)P(g?gfHv;=}=d$a8`m*7tWvO%x*>P)mBlT*>xXK6O z0y;V~Zf%J~XO%CQS8Wr6z1aqly~a)a26>WmCfKmcE%L_cR>Ku-cC(RnE}alee&cVA m(em4d6NWIoN7tpB5;Px6*9SdY?`c$K8JGR4 { const [start, setStart] = useState(initials); const [end, setEnd] = useState({ ...initials, month: 12 }); const [checkedDiv, setCheckedDiv] = useState<(string | number)[]>([ - 'Div. 2', - 'Div. 3', + "Div. 2", + "Div. 3", ]); const [updateList, setUpdateList] = useState(0); @@ -51,28 +51,37 @@ const Setting = () => { update(); }, [updateList]); - const getEpo = (date: ChooserState) => { - if (date.month && date.year) { - let dateString = ''; - dateString += date.year + '-'; - if (date.month < 10) dateString += '0' + date.month; - else dateString += date.month; - dateString += '-01'; - date.epoch = new Date(dateString).getTime(); - return date; - } - return date; + const getEpo = (Nowdate: ChooserState, type: string): number => { + const date = { + ...Nowdate, + month: + type != "ENDING" + ? Nowdate.month + : Nowdate.month != 12 + ? Nowdate.month + 1 + : 1, + year: + type != "ENDING" || Nowdate.month != 12 + ? Nowdate.year + : Nowdate.year + 1, + }; + + let dateString = ""; + dateString += date.year + "-"; + if (date.month < 10) dateString += "0" + date.month; + else dateString += date.month; + dateString += "-01"; + date.epoch = new Date(dateString).getTime(); + return date.epoch; }; useEffect(() => { - const date = getEpo(start); - setStart(date); - dispatch(setEpochStart(date.epoch)); + const epoch = getEpo(start, "STARTING"); + dispatch(setEpochStart(epoch)); }, [start]); useEffect(() => { - const date = getEpo(end); - setEnd(date); - dispatch(setEpochEnd(date.epoch)); + const epoch = getEpo(end, "ENDING"); + dispatch(setEpochEnd(epoch)); }, [end]); useEffect(() => { @@ -97,7 +106,7 @@ const Setting = () => { alignItems="center" > - From:{' '} + From: { - Division:{' '} + Division:{" "} setCheckedDiv(value)} > - + Div. 1