handy date comparison hack

handy date comparison hack

For people that want to check if a chosen date is before or after the current date: just subtract them. It gives a nonsensical number, but the sign is all telling.

dateChosen = input.Date1;
dateCurrent = zoho.currentDate;

dateRemainder = dateChosen-dateCurrent;
if (dateRemainder<0){
      // day is in the past
}
if (dateRemainder==0){
      // day is current
}
if (dateRemainder>0){
      // day is in the future
}

Just wanted to share this with you, so that you don't have to break your head about this thing.. It would be nice if zoho supported this standard.