Calendar field type display one format, but store another #709
dformdotdk
started this conversation in
Ideas
Replies: 2 comments 6 replies
-
I don't understand I pointed you to a post here in discussions that answers this question, did you check it out? if yes what am I missing? |
Beta Was this translation helpful? Give feedback.
6 replies
-
The solution is actually given here: #672 Current solution: Set modelling mode to export and add the code on save model
Set on get model to: // Not needed |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When working with the calendar field type we normally need to store the value in the database as in this format 0000-00-00 00:00:00 (%Y-%m-%d %H:%I.%S).
However, JCB allow us to translate the format, to what is native to the user, e.g. %d-%m-%Y %H:%I.%S. But if we use translate format, then the field will not save to the database, as it will try to save in the translated format and not the format set in the format property.
In other words, I would like to be able to translate the format when displayed to the user, like e.g. 23-03-2021 22:32:37, but store it in the database as 2021-03-23 22:32:37.
I'm sure there is a way to do this, but it would be awesome if JCB could support this out of the box, when translate format was set to true.
Beta Was this translation helpful? Give feedback.
All reactions