correction on date comparison and date parsing