Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. var times = [{'time':'01:00 AM'}, {'time':'06:00 PM'}, {'time':'12:00 PM'} ,{'time':'03:00 AM'},{'time':'12:00 AM'}];
  2. console.log('times 1...',times);
  3. times.sort(function (a, b) {
  4. return new Date('1970/01/01 ' + a.time) - new Date('1970/01/01 ' + b.time);
  5. });
  6. console.log('times 2...',times);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement