I have a problem that requires me to take two times in 12 hour format and compare them, we have moment.js included in our project and we initially thought it would be as tri
8:45am and 9:00am are invalid dates
var beginningTime = moment('8:45am');
var endTime = moment('9:00am');
console.log(beginningTime.isValid(), endTime.isValid()) // FALSE
You should use a valid format: http://momentjs.com/docs/#/parsing/string/
And they suggest that for consistent results, should use http://momentjs.com/docs/#/parsing/string-format/
Eg.
moment("2010-10-20 4:30", "YYYY-MM-DD HH:mm"); // parsed as 4:30 local time