fix redundancy in date code