Date handling error

Both date and dateTime methods expects strings and no \Datetime objects. 
Those strings needs to be converted to objects for be able to "->format('date format')"

Maybe a more elegant ways could be check type of value before doing anything.