fix the date type comparison