Dates format

#14 · closed · 1 comments

View on GitHub ↗

jguittard

Dates for field mappings are restricted to `Y-m-d` format. Although it's a common format, it should be possible to override a default format through the `DASPRiD\Formidable\Mapping\Formatter\DateFormatter` constructor. Will provide a PR within 2 days

Comments

DASPRiD

The reason for that is that the `<input type="date"/>` will always transmit dates in that format, no matter which format is displayed to the user. This and the other datetime and time formatters are also meant for similar purposes. The proper solution to your problem should be to use a datepicker on your front end which follows that behaviour, instead of modifying Formidable. One possible implementation which follows that HTML standard is this one: https://github.com/DASPRiD/Bootstrap-DatePicker I'm closing this issue as as won't fix, as any modification would not only require to simply specify a date format, but also to use `ext-intl` to parse dates which come with localized month names or such. Apart from that, Formidable should encourage use of modern standards. Thanks for your efforts though.