Details
Description
The DatePicker does not use the format parameter to format the date as specified.
code patch (starting at line 118):
DateTranslator translator = (DateTranslator) getTranslator();
Locale locale = getPage().getLocale();
SimpleDateFormat format = translator.getDateFormat(locale);
with:
DateTranslator translator = (DateTranslator) getTranslator();
if (!(getFormat() == null || getFormat().equals("")))
Locale locale = getPage().getLocale();
SimpleDateFormat format = translator.getDateFormat(locale);
i.e. add :
if (!(getFormat() == null || getFormat().equals(""))) { translator.setPattern(getFormat()); }
I am not sure whether this is the correct approach but it works, and I am not sure of the affect this will have on the new validation system where a translator is specified.
The problem I was having was that I was specifying a format="'dd/MM/yyyy'" but it was always coming out as MM/dd/yyyy even though the browser and locale when tested in java code was reading en-gb, this should be overridden by format anyway.