Reworked some of the code for handling the Dates