1var date1 = new Date('December 25, 2017 01:30:00');
2var date2 = new Date('June 18, 2016 02:30:00');
3
4//best to use .getTime() to compare dates
5if(date1.getTime() === date2.getTime()){
6 //same date
7}
8
9if(date1.getTime() > date2.getTime()){
10 //date 1 is newer
11}
1var date1 = new Date('December 25, 2017 01:30:00');
2var date2 = new Date('June 18, 2016 02:30:00');
3
4//best to use .getTime() to compare dates
5if(date1.getTime() === date2.getTime()){
6 //same date
7}
8
9if(date1.getTime() > date2.getTime()){
10 //date 1 is newer
11}