fix a bug on date formatting