Changeset b248810 for jobvista-frontend/src/utils
- Timestamp:
- 06/10/24 22:34:32 (5 months ago)
- Branches:
- main
- Children:
- befb988
- Parents:
- 28b3398
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/utils/utils.js
r28b3398 rb248810 1 1 2 2 3 export const sortElementsBy DateCreated = (array) => {3 export const sortElementsBy = (array, column) => { 4 4 return array.slice().sort((a, b) => { 5 return new Date(b .postedOn).getTime() - new Date(a.postedOn).getTime()5 return new Date(b[column]).getTime() - new Date(a[column]).getTime() 6 6 }); 7 7 } … … 9 9 export const sortElementsBySubmissionDate = (array) => { 10 10 return array.slice().sort((a, b) => { 11 return new Date(b .postedOn).getTime() - new Date(a.postedOn).getTime()11 return new Date(b).getTime() - new Date(a.postedOn).getTime() 12 12 }); 13 13 }
Note:
See TracChangeset
for help on using the changeset viewer.