Announcement

Collapse
No announcement yet.

Sort dates in an Array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sort dates in an Array

    Need to sort dates in descending order in an Array.

    So basically I have the below :

    var myDate = new Array();
    myDate[0] = 2020-06-24T06:42:02.5529665+00:00;
    myDate[1] = 2020-06-02T07:33:16.7502365+00:00;
    myDate[2] = 2020-05-04T13:18:40.523729+00:00;
    myDate[3] = 2020-06-29T00:11:46.9244486+00:00;

    The date format is exactly as shown above, which I cannot change for certain reasons.

    I need to sort the above values in descending orders..

    Any help is greatly appreciated.


  • #2
    I was able to sort this by not using any arguments :

    myDate.sort();

    Comment

    Working...
    X