As you have noticed, the value you receive is type of string and therefore it is sorted alphabetically. You need to convert it into Date() beforehand. So basically what you need is to loop over the array of data you got and add a new property (or replace existing one) with a new Date object:
referral.forEach((ref) => {
ref.date_obj = new Date(ref.date)
};
I just checked, JavaScript seems to be parsing format "September 13, 2016" pretty well.
Share
Post a Comment
for "Sorting Angularjs Ng-repeat By Date"
Post a Comment for "Sorting Angularjs Ng-repeat By Date"