Skip to content

Commit

Permalink
ADM-973 [frontend] feat: fix sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
Mandy-Tang committed Jul 12, 2024
1 parent 5ea5582 commit 75cf10f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ export const formatDateToTimestampString = (date: string) => {

export const sortDateRanges = (dateRanges: DateRangeList, descending = true) => {
const result = [...dateRanges].sort((a, b) => {
return dayjs(b.startDate as string).diff(dayjs(a.startDate as string));
return dayjs(b.startDate).diff(dayjs(a.startDate));
});
return descending ? result : result.reverse();
};

export const sortReportInfos = (reportInfos: IReportInfo[], descending = true) => {
const result = [...reportInfos].sort((a, b) => {
return dayjs(b.id as string).diff(dayjs(a.id as string));
return dayjs(b.id).diff(dayjs(a.id));
});
return descending ? result : result.reverse();
};
Expand Down

0 comments on commit 75cf10f

Please sign in to comment.