Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var times = [{'time':'01:00 AM'}, {'time':'06:00 PM'}, {'time':'12:00 PM'} ,{'time':'03:00 AM'},{'time':'12:00 AM'}];
- console.log('times 1...',times);
- times.sort(function (a, b) {
- return new Date('1970/01/01 ' + a.time) - new Date('1970/01/01 ' + b.time);
- });
- console.log('times 2...',times);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement