fix date to string bugs