Added date-to-integer conversion, with tests