I have this arrangement:
var arr = ["2018-06-07","2018-06-30","2018-06-01","2018-06-21","2018-07-20"];
And I need to get the maximum and minimum date with javascript, I have tried with this function:
var min = new Date(Math.max.apply(null,arr));
var max = new Date(Math.min.apply(null,arr));
But they give me back a "NaN" value.
What will I be doing wrong? or is there another way to get the major and minor date of an arrangement ?, Thanks