Created
June 17, 2020 05:13
-
-
Save nhatnx/59d366c3b16dec6d0a435a8a55f65a33 to your computer and use it in GitHub Desktop.
Min/Max of dates in an array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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