javascript - FullCalendar moment.js. When check if clicked date (tomorrow) isBefore() today, return true -


i'm doing calendar full calendar , moment. j's. when click on past day or today, it's supposed return true". if clicked date in future, return false.

so, when click on current date (2017-04-06), it's returning true.

if click on date after tomorrow (2017-04-08), it's returning false.

but, if click on tomorrow date (2017-04-07), it's returning true.

there code:

... dayclick: function(date, allday, jsevent, view) {      var currentdate = moment();     var clickeddate = date;      if(clickeddate.isbefore(currentdate)){         console.log(clickeddate.date());         console.log(currentdate.date());         console.log("true");     } else {         console.log(clickeddate.date());         console.log(currentdate.date());         console.log("false");     } }, ... 


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -