aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock/farmingContents.ts
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-05 22:10:56 -0500
committermat <github@matdoes.dev>2022-04-05 22:10:56 -0500
commit988122c5d6f94a4abf6446b0a8a7132ddb12737c (patch)
tree2cfa1b9e2985082e4f79fcf3a46bcacedbb36d9f /src/cleaners/skyblock/farmingContents.ts
parent4b706d309e30d92b7b143d1879d9298fdba53141 (diff)
downloadskyblock-api-988122c5d6f94a4abf6446b0a8a7132ddb12737c.tar.gz
skyblock-api-988122c5d6f94a4abf6446b0a8a7132ddb12737c.tar.bz2
skyblock-api-988122c5d6f94a4abf6446b0a8a7132ddb12737c.zip
sort farming contests by newest first
Diffstat (limited to 'src/cleaners/skyblock/farmingContents.ts')
-rw-r--r--src/cleaners/skyblock/farmingContents.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cleaners/skyblock/farmingContents.ts b/src/cleaners/skyblock/farmingContents.ts
index 3727621..039c725 100644
--- a/src/cleaners/skyblock/farmingContents.ts
+++ b/src/cleaners/skyblock/farmingContents.ts
@@ -49,7 +49,11 @@ export function cleanFarmingContests(data: typedHypixelApi.SkyBlockProfileMember
contestsByDate[contestByDateKey].push(cropData)
}
- const contests: PlayerFarmingContestStats[] = Object.entries(contestsByDate).map(([contestDateKey, crops]) => {
+ const contestsByDateEntries = Object.entries(contestsByDate)
+ // this is to sort by newest first
+ contestsByDateEntries.reverse()
+
+ const contests: PlayerFarmingContestStats[] = contestsByDateEntries.map(([contestDateKey, crops]) => {
const [year, month, day] = contestDateKey.split(':')
return {
year: parseInt(year),