fix a bug around date