mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix: swapped start and end min and max
This commit is contained in:
1 parent
e806f0ede2
commit
d448101b32
2 files changed
+12
-12
No files matched your search
@@ -30,13 +30,13 @@ export default function resolvePeriodFromCommand(
|
|||||||
if (periodSubcommand === 'custom') {
|
if (periodSubcommand === 'custom') {
|
||||||
const startRaw = interaction.options.getInteger('start', true);
|
const startRaw = interaction.options.getInteger('start', true);
|
||||||
const endRaw = interaction.options.getInteger('end', true);
|
const endRaw = interaction.options.getInteger('end', true);
|
||||||
const startDaysAgoMax = Math.min(startRaw, endRaw);
|
const startDaysAgoMin = Math.min(startRaw, endRaw);
|
||||||
const endDaysAgoMin = Math.max(startRaw, endRaw);
|
const endDaysAgoMax = Math.max(startRaw, endRaw);
|
||||||
|
|
||||||
statsName = `${startDaysAgoMax} to ${endDaysAgoMin} days' statistics`;
|
statsName = `${startDaysAgoMin} to ${endDaysAgoMax} days' statistics`;
|
||||||
evolutionName = `${startDaysAgoMax} to ${endDaysAgoMin} days' evolution`;
|
evolutionName = `${startDaysAgoMin} to ${endDaysAgoMax} days' evolution`;
|
||||||
start = getTimeDaysAgo(region, endDaysAgoMin);
|
start = getTimeDaysAgo(region, endDaysAgoMax);
|
||||||
end = getTimeDaysAgo(region, startDaysAgoMax);
|
end = getTimeDaysAgo(region, startDaysAgoMin);
|
||||||
} else {
|
} else {
|
||||||
statsName = `${getPeriodOptionName(periodOption)} Statistics`;
|
statsName = `${getPeriodOptionName(periodOption)} Statistics`;
|
||||||
evolutionName = `${getPeriodOptionName(periodOption)} Evolution`;
|
evolutionName = `${getPeriodOptionName(periodOption)} Evolution`;
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ export default function resolvePeriodFromURL(
|
|||||||
if (periodSubcommand === 'custom') {
|
if (periodSubcommand === 'custom') {
|
||||||
const startRaw = parseInt(url!.searchParams.get('start')!);
|
const startRaw = parseInt(url!.searchParams.get('start')!);
|
||||||
const endRaw = parseInt(url!.searchParams.get('end')!);
|
const endRaw = parseInt(url!.searchParams.get('end')!);
|
||||||
const startMin = Math.min(startRaw, endRaw);
|
const startDaysAgoMin = Math.min(startRaw, endRaw);
|
||||||
const endMax = Math.max(startRaw, endRaw);
|
const endDaysAgoMax = Math.max(startRaw, endRaw);
|
||||||
|
|
||||||
statsName = `${startMin} to ${endMax} days' statistics`;
|
statsName = `${startDaysAgoMin} to ${endDaysAgoMax} days' statistics`;
|
||||||
evolutionName = `${startMin} to ${endMax} days' evolution`;
|
evolutionName = `${startDaysAgoMin} to ${endDaysAgoMax} days' evolution`;
|
||||||
start = getTimeDaysAgo(server, startMin);
|
start = getTimeDaysAgo(server, endDaysAgoMax);
|
||||||
end = getTimeDaysAgo(server, endMax);
|
end = getTimeDaysAgo(server, startDaysAgoMin);
|
||||||
} else {
|
} else {
|
||||||
statsName = `${getPeriodOptionName(periodOption)} Statistics`;
|
statsName = `${getPeriodOptionName(periodOption)} Statistics`;
|
||||||
evolutionName = `${getPeriodOptionName(periodOption)} Evolution`;
|
evolutionName = `${getPeriodOptionName(periodOption)} Evolution`;
|
||||||
|
|||||||
Reference in new issue
Block a user