hofff / contao-calendarfield

GNU Lesser General Public License v3.0
18 stars 3 forks source link

The frontend calendar always return "dd/mm/yyyy" format #36

Closed IterationCorp closed 7 years ago

IterationCorp commented 7 years ago

Hello

Date format from Contao in settings is : Y-m-d, so I setup the same for your calendar picker validation.

The calendar picker always return something like 30/01/2017 and not 2017-01-30, so validation is not working.

I understand how to activate the validation, but how to make the calendar picker return the correct date format? Thanks

cliffparnitzky commented 7 years ago

oh. Thank you for the report. It seems, the format will be generated out of the regional definition (language of the root page). Generally this is a bug, because the extension sets a parameter format but the correct name should be dateFormat (http://api.jqueryui.com/datepicker/#option-dateFormat).

We will fix this soon.

cliffparnitzky commented 7 years ago

@IterationCorp Please try https://github.com/hofff/contao-calendarfield/commit/9984870caecf9f5bacc03111d33d154fd76acde5 ... the probleme should be fixed.

There was also a bug with receiving the date format from the configuration. Now, the format will be searched in the following order:

IterationCorp commented 7 years ago

Thank you so much! Look like ok now. Your plugin is really essential to make Contao works in a proper way. I'm really surprised this behaviour is not in the native Contao code.