formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.89k stars 1.06k forks source link

Unable to specify different "format" and "dateFormat" in calendar widget #4810

Closed hancock309 closed 9 months ago

hancock309 commented 2 years ago

I have a need to use a calendar widget with the following settings

EnableTime = false,
Format = "dd-MMM-yyyy",
DateFormat = "yyyy-MM-dd",

The date has to be stored as "yyyy-MM-dd" in my database, but should be displayed as "dd-MMM-yyyy" in the textbox.

This worked fine until this line of code was added to the constructor: this.settings.dateFormat = this.settings.format; https://github.com/formio/formio.js/blob/a83b1badb52cea11fab5d1242b86beb5a0fa098e/src/widgets/CalendarWidget.js#L69

Now, whatever I specify as Format is not being honored

alekseyBatuhtin commented 2 years ago

Same issue. @hancock309 did you solve the problem?

hancock309 commented 2 years ago

@alekseyBatuhtin, no... I did not find a workaround :(

I was forced to go back to version 4.13.8. If you figure something out, please let me know

daneformio commented 9 months ago

Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!