skip to Main Content

sort array in a date string property, using lodash or moment() or simple javascript

this is my test array: let testArray = [{'Datum':'13/05/2024','ID':1}, {'Datum':'18/05/2013','ID':2},{'Datum':'01/05/2018','ID':3}, {'Datum':'31/05/2024','ID':4},{'Datum':'31/05/2024','ID':5}] trying to order by Datum property ascending/descending order but it is not happening here is my logic: _.orderBy(testArray, ['Datum'], ['asc']); //not working using moment() js _.orderBy(testArray, (o) => {…

VIEW QUESTION
Back To Top
Search