mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: merged stats and tankstats
This commit is contained in:
1 parent
0cf0e63fda
commit
d9690460d5
14 files changed
+195
-338
No files matched your search
@@ -0,0 +1,12 @@
|
||||
export default function getTimeDaysAgo(period: number) {
|
||||
const now = new Date();
|
||||
now.setHours(5, 0, 0, 0);
|
||||
|
||||
// if it's after 5:00 AM today, subtract one day
|
||||
if (now.getTime() > Date.now()) now.setDate(now.getDate() - 1);
|
||||
|
||||
// subtract the period number of days from now
|
||||
now.setDate(now.getDate() - period);
|
||||
|
||||
return now.getTime() / 1000;
|
||||
}
|
||||
Reference in new issue
Block a user