[RFC] [2.2] Convert Timestamp for date widgets#421
[RFC] [2.2] Convert Timestamp for date widgets#421richardhj wants to merge 1 commit intocontao-community-alliance:masterfrom
Conversation
We can give the event listener a low priority and extend the event listeners condition to: if (!\is_int($event->getValue()) {
return;
} |
|
Not sure this is a BC break. In my opinion, this should only be adopted in the next major. You could use a parameter in the evaluation to control whether the date can be converted. @discordier What do you mean? |
|
It's not about whether this is a bug. Hence my idea to activate the conversion in the Configuration field. Otherwise we need a database upgrade for the DCG, which is not up to the DCG. That's why I thought you could handle this properly in the next major release, if it's necessary at all. In the future DCG will use the Doctrine Abstraction Layer. |
|
It is still my opinion that the Unix timestamp is not the most elegant format for MySQL to store date and time! MySQL has a data format with a much wider range ('1000-01-01 00:00:00:00' to '9999-12-31 23:59:59') and saves the incorrect conversions from the timestamp - see also MetaModels/core#881 (duplicate of #415 (comment)) |
I can see the point, but from what I read, the MySQL date format ist time zone agnostic, meaning that you are not able to change the timezone in the system setting. The second point (@discordier mentioned somewhere) is that you are not compatible with Contao. |
discordier
left a comment
There was a problem hiding this comment.
Will there still be some action on this or shall we archive this PR?

Description
Convert date widget values to timestamps on encode property value and vice-versa on decode property value.
Closes #415.
Checklist
@authorsin touched PHP filesThis code is simliar to https://github.com/MetaModels/attribute_timestamp/blob/2.0.4/src/MetaModels/Attribute/Timestamp/BootSubscriber.php#L56-L100
We need to ensure that both event listeners (the one of DCG and the one of MM) do not conflict.