mirror of
https://github.com/hex248/year.git
synced 2026-02-07 18:23:03 +00:00
use .getTime()
This commit is contained in:
@@ -27,7 +27,7 @@ app.get("/", async (c) => {
|
|||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const start = new Date(now.getFullYear(), 0, 0);
|
const start = new Date(now.getFullYear(), 0, 0);
|
||||||
const diff = now - start;
|
const diff = now.getTime() - start.getTime();
|
||||||
const oneDay = 1000 * 60 * 60 * 24;
|
const oneDay = 1000 * 60 * 60 * 24;
|
||||||
const today = Math.floor(diff / oneDay) - 1;
|
const today = Math.floor(diff / oneDay) - 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user