Skip to content Skip to sidebar Skip to footer

Date.gettime Is Not A Function

I am trying to compare some dates in javascript/jquery. But I am getting some error. What I did wrong here? dayRender: function (date, cell) { console.log(date.getTime()) }

Solution 1:

var date = newDate();
console.log(date.getDate());

Instead of passing date object everytime you call dayRender(), you can use date directly in that function.

dayRender: function(cell) {
  var date = new Date();
  console.log(date.getTime());
  console.log(date.getDate());
  console.log(date.getYear());
}   

Solution 2:

Try to convert date into date object hope it works

dayRender: function (date, cell) {
    dateObj =newDate(date);
    console.log(date.getDate());
}

Post a Comment for "Date.gettime Is Not A Function"