Created
February 14, 2014 05:17
-
-
Save arr-ee/8996177 to your computer and use it in GitHub Desktop.
Javascript is awesome at sorting stuff.
This file contains 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
> a | |
[ 'Wed Dec 11 2013 04:00:00 GMT+0400 (MSK)', | |
'Tue Dec 10 2013 04:00:00 GMT+0400 (MSK)', | |
'Sun Dec 15 2013 04:00:00 GMT+0400 (MSK)', | |
'Sat Dec 14 2013 04:00:00 GMT+0400 (MSK)' ] | |
> a.map(function(d){return new Date(d)}).sort() | |
[ Sat Dec 14 2013 04:00:00 GMT+0400 (MSK), | |
Sun Dec 15 2013 04:00:00 GMT+0400 (MSK), | |
Tue Dec 10 2013 04:00:00 GMT+0400 (MSK), | |
Wed Dec 11 2013 04:00:00 GMT+0400 (MSK) ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment