mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-19 20:03:51 +01:00
fix: time zone compliant commands
This commit is contained in:
1 parent
dd0644e09f
commit
405f544774
11 files changed
+54
-30
No files matched your search
@@ -1,12 +1,16 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { Period } from '../discord/addPeriodSubCommands.js';
|
||||
import getTimeDaysAgo from './getTimeDaysAgo.js';
|
||||
|
||||
export default function getPeriodStart(period: Exclude<Period, 'custom'>) {
|
||||
export default function getPeriodStart(
|
||||
server: BlitzServer,
|
||||
period: Exclude<Period, 'custom'>,
|
||||
) {
|
||||
if (period === 'career') {
|
||||
return -Infinity;
|
||||
} else if (period === 'today') {
|
||||
return getTimeDaysAgo(0);
|
||||
return getTimeDaysAgo(server, 1);
|
||||
} else {
|
||||
return getTimeDaysAgo(parseInt(period));
|
||||
return getTimeDaysAgo(server, parseInt(period));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user