-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] [2.2] Convert Timestamp for date widgets #421
base: master
Are you sure you want to change the base?
[RFC] [2.2] Convert Timestamp for date widgets #421
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@authors
in 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.