Compare data column value to system clock

superted

New Member
I'm am fairly new to JavaScript/jQuery so bare with me. I have a data-table with a particular column called "scheduled time" that has is using the "Time" variable. I would like to know what's the easiest way to compare the scheduled time in the table to the system time, and in return change the background colour of the row. My code so far\[code\]var currentTime = new Date(); /* not sure if this is the correct time object to use */var scheduledTime = scheduledTime();if (scheduledTime >= 15mins) { return 'background-color:red;'} else if (scheduledTime > 15mins <= 30mins) { return 'background-color:yellow;'} else if (scheduledTime > 30mins <= 2hours) { return 'background-color:green;'} else if (scheduledTime > 2hours) { return 'background-color:none;}\[/code\]
 
Back
Top