I am new to moment.js. I have a date object, and it has some time associated with it. I just want to check if this date is greater than or equal to today's date , excluding comparison time.
var dateToCompare = 2015-04-06T18:30:00.000Z
I just want to check if dateToCompare is equal to or greater than today's date. I checked the isSame of the .js moment, but it seems to take a string and only part of the date. But I do not want to convert my date to a string or manipulate it further. Because I'm worried that javascript might do something unexpected when converting this date to a string (like adding an offset or dst, etc.), Or maybe I'm wrong.
Sample isSame () from docs
moment('2010-10-20').isSame('2010-10-20');
I am also looking for something like isSame () and isAfter () together as one operator.
I need to compare only with the moment.js parameter. Please do not offer simple javascript date matching.
javascript momentjs
NoobGeek Apr 7 '15 at 14:49 2015-04-07 14:49
source share