fixed bug in figuring out which date format to show.