mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: updated /tankstats
This commit is contained in:
1 parent
50369e9225
commit
831300cf69
13 files changed
+300
-272
No files matched your search
@@ -0,0 +1,3 @@
|
||||
export default function getPeriodNow() {
|
||||
return new Date().getTime() / 1000;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { StatPeriod } from '../options/addStatPeriodChoices.js';
|
||||
|
||||
export default function getPeriodicStart(period: StatPeriod) {
|
||||
if (period === 'career') {
|
||||
return -Infinity;
|
||||
} else {
|
||||
const daysAgo = period === 'today' ? 0 : Number(period) - 1;
|
||||
const periodStart = new Date();
|
||||
|
||||
periodStart.setDate(periodStart.getDate() - daysAgo);
|
||||
periodStart.setHours(5, 0, 0, 0);
|
||||
|
||||
return periodStart.getTime() / 1000;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user