Fix bugs of dates