Skip to content

Commit

Permalink
changed events sorting to take most recent event for each categ
Browse files Browse the repository at this point in the history
  • Loading branch information
UngererFabien authored and rik committed Jan 29, 2025
1 parent eb676d6 commit 2147f79
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/utils/enrichProcedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import dayjs from 'dayjs'

function sortEvents(events) {
return events.sort((a, b) => {
return +dayjs(a.date_iso) - +dayjs(b.date_iso)
return +dayjs(b.date_iso) - +dayjs(a.date_iso)
})
}

Expand Down
2 changes: 1 addition & 1 deletion server/utils/fetchCommunesProcedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import dayjs from 'dayjs'

function sortEvents(events) {
return events.sort((a, b) => {
return a.timestamp - b.timestamp
return b.timestamp - a.timestamp
})
}

Expand Down
2 changes: 1 addition & 1 deletion server/utils/fetchProceduresChunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import dayjs from 'dayjs'

function sortEvents(events) {
return events.sort((a, b) => {
return +dayjs(a.date_iso) - +dayjs(b.date_iso)
return +dayjs(b.date_iso) - +dayjs(a.date_iso)
})
}

Expand Down

0 comments on commit 2147f79

Please sign in to comment.