I'm trying to compare the date of today with the date in a date field from a SP listitem.
The date of today is returned like: [date] Thu Mar 29 12:09:08 UTC+0200 2018 and the date in my field (LTIOV) like: [date] Sun Jul 5 00:00:00 UTC+0200 2020
The second date is wrong as in the listitem it is : 31-5-2018
I tried the following javascript to compare but it doesn't work:
var date = new Date(listItem.LTIOV);
var todaysDate = new Date();
console.log(todaysDate);
console.log(date);
if ((date < todaysDate) && (listItem.MijnStatus == "In Action")) {
if (row != null)
row.style.backgroundColor = "rgba(153, 204, 255, 0.5)"; //light blue
}
How can I compare these two?