You are here
Improve TypedData date handling
At #1778178: Convert comments to the new Entity Field API it turned out that the current date handling of the typed data API is sub-optimal. Creating DateTime instances is costly, so it needs to be well-thought. Also, it's a bit strange to have $typed_data wrapping another object - the DateTime object, so you end up with code like
$comment->created->value->getTimestamp(). Then the storage has to take care of properly mapping the date value back to the storage format, thus it requires additional metdata.
Because of that #1778178: Convert comments to the new Entity Field API does not implement proper date fields yet, but defines the timestamps as simple integer_item fields.
Let's re-think possible options here and fix the implementation.