At the moment the date type validate only an integer (i.e. datestamp).
It could be useful to validate also datetime and ISO date format so it could be possible to provide a property setter callback for date (see #1153766)
Attached a patch.

CommentFileSizeAuthor
entity.property_date_validation.patch526 byteslucor

Comments

quazardous’s picture

+1

quazardous’s picture

Status: Active » Needs review
sharonknieper’s picture

+1....this aspect of Entity API makes it so the Search API module only accepts dates stored as datestamps (no iso dates) and it would be really helpful to see it resolved at the correct level.

fago’s picture

Status: Needs review » Closed (works as designed)

Yes, but this isn't the correct level. Entity API documents dates have to be timestamps, so modules have to care about that, i.e. if they have to deal with other date-formats they need to convert them in the respective getter/setter callbacks.
That way, users of the API/property can rely on the fact that dates have to be passed in and are returned as timestamp.

mihai_brb’s picture

Issue summary: View changes

This means you can't have a mysql date property and use metadata wrapper to set it's value, right?