Modify datify to check isinstance of datetime first and then date because a
datetime is an instance of date.