mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 10:23:54 +00:00
14 lines
313 B
JavaScript
14 lines
313 B
JavaScript
export const sortByDate = (arr) => {
|
|
const sorter = (a, b) => {
|
|
return new Date(a.timeStart).getTime() - new Date(b.timeStart).getTime();
|
|
};
|
|
return arr.sort(sorter);
|
|
};
|
|
|
|
export const sortByNumber = (arr) => {
|
|
const sorter = (a, b) => {
|
|
return a.order - b.order;
|
|
};
|
|
return arr.sort(sorter);
|
|
};
|