Skip to content

Commit 09915ba

Browse files
authored
Merge pull request #140 from Solux-WebBeing/fix/imminent
wfwe
2 parents 25efca5 + 6bdd2e8 commit 09915ba

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

โ€Žbackend/src/controllers/board.controller.jsโ€Ž

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,10 @@ const calculateSortFields = (endDateISO) => {
2828
const end = new Date(endDateISO).getTime();
2929

3030
// KST ์˜ค๋Š˜ ๋ฒ”์œ„(UTC๋กœ ํ™˜์‚ฐ)
31-
const kstDateStr = new Date(
32-
nowUtc + 9 * 60 * 60 * 1000
33-
).toISOString().slice(0, 10); // YYYY-MM-DD (KST ๊ธฐ์ค€)
34-
35-
// โœ… ๊ทธ ๋‚ ์งœ์˜ KST 00:00 / 23:59:59๋ฅผ UTC ms๋กœ ๊ณ„์‚ฐ
36-
const kstTodayStartUtc =
37-
Date.parse(`${kstDateStr}T00:00:00+09:00`);
38-
const kstTodayEndUtc =
39-
Date.parse(`${kstDateStr}T23:59:59+09:00`);
40-
31+
const kstNow = now + 9 * 60 * 60 * 1000;
32+
const d = new Date(kstNow);
33+
const kstTodayStart = Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), 0, 0, 0, 0) - 9*60*60*1000;
34+
const kstTodayEnd = kstTodayStart + 24*60*60*1000 - 1;
4135

4236
// ๋งˆ๊ฐ
4337
if (end < now) return { sort_group: 3, sort_end: end };
@@ -51,6 +45,7 @@ const calculateSortFields = (endDateISO) => {
5145

5246

5347

48+
5449
/**
5550
* [Helper] ImgBB ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ ํ•จ์ˆ˜
5651
*/

0 commit comments

Comments
ย (0)