mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-14 21:26:08 +01:00
feat: wm8 and average tier calculation
This commit is contained in:
1 parent
c2fca42a86
commit
a12f969251
15 files changed
+315
-328
No files matched your search
@@ -3,8 +3,16 @@ import { StatPeriod } from '../options/addStatPeriodChoices.js';
|
||||
export default function getPeriodicStart(period: StatPeriod) {
|
||||
if (period === 'career') {
|
||||
return -Infinity;
|
||||
} else if (period === 'today') {
|
||||
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);
|
||||
|
||||
return now.getTime() / 1000;
|
||||
} else {
|
||||
const daysAgo = period === 'today' ? 0 : Number(period) - 1;
|
||||
const daysAgo = Number(period) - 1;
|
||||
const periodStart = new Date();
|
||||
|
||||
periodStart.setDate(periodStart.getDate() - daysAgo);
|
||||
|
||||
Reference in new issue
Block a user