You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Paul Ferraro (JIRA)" <ta...@jakarta.apache.org> on 2005/07/01 22:35:58 UTC
[jira] Commented: (TAPESTRY-367) DatePicker ignores format parameter
[ http://issues.apache.org/jira/browse/TAPESTRY-367?page=comments#action_12314918 ]
Paul Ferraro commented on TAPESTRY-367:
---------------------------------------
Actually, the "format" parameter needs to be removed from DatePicker. The DatePicker's date format is now specified via a DateTranslator.
> DatePicker ignores format parameter
> -----------------------------------
>
> Key: TAPESTRY-367
> URL: http://issues.apache.org/jira/browse/TAPESTRY-367
> Project: Tapestry
> Type: Bug
> Components: Framework
> Versions: 4.0
> Environment: Tapestry 4.0-beta-2-snapshot and 4.0-beta-1
> Reporter: Paul Green
>
> 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(""))) {
> translator.setPattern(getFormat());
> }
> 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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org