Hi,
You can use something like this:
var currVal = getFieldValue("DateColumn1");
setInterval(function () {
var val = getFieldValue("DateColumn1");
if (val !== currVal) {
currVal = val;
// Changed - run your code here
var now = new Date();
var currDate = spjs.utility.getDateFieldAsDateObject("DateColumn1");
// Correct hour, minute and second to make a comparison on date only
now.setHours(12, 0, 0);
currDate.setHours(12, 0, 0);
if (currDate > now) {
alert("Greater than today");
} else {
alert("Less than or equal to today");
}
}
}, 1000);
Change “DateColumn1” to match your field internal name.
Alexander