Fix issue with initialising date object using only 1 argument

This fixes invalid date when trying to initialise a date using a
integer value i.e. valueOf from another date object.