Skip to content

Instantly share code, notes, and snippets.

@nhatnx
Created June 17, 2020 05:13
Show Gist options
  • Save nhatnx/59d366c3b16dec6d0a435a8a55f65a33 to your computer and use it in GitHub Desktop.
Save nhatnx/59d366c3b16dec6d0a435a8a55f65a33 to your computer and use it in GitHub Desktop.
Min/Max of dates in an array
var dates=[];
dates.push(new Date("2011/06/25"));
dates.push(new Date("2011/06/26"));
dates.push(new Date("2011/06/27"));
dates.push(new Date("2011/06/28"));
var maxDate=new Date(Math.max.apply(null,dates));
var minDate=new Date(Math.min.apply(null,dates));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment