Fixed compareDate method for Scheduler.