我试图仅显示notifications
users
仅 <}输入的today's
匹配此格式的某些日期2017/11/13 15:02
来自{ {1}}
注意:record
将始终更改,用于比较
2017/11/13 15:02
我尝试过类似的内容
if(today's date passed and dont match 2017/11/13 15:02){
//don't send notification
}else{
//send notification
}
答案 0 :(得分:0)
getTime()方法将为您提供自纪元以来以毫秒为单位的时间戳,您可以将其与新Date,Date.parse()一起使用,但是已经返回时间戳。
var comparisionDate = Date.parse('2017/11/13 15:02');
var todaysDate = new Date(); // current date
// further i don't know to compare
if(comparisionDate == todaysDate.getTime() ){
//send notifications
alert("Today's date " + todaysDate.getTime() + " equals " + comparisionDate);
}else{
// don't show notification
alert("Today's date " + todaysDate.getTime() + " Not equals " + comparisionDate);
}