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 Green (JIRA)" <ta...@jakarta.apache.org> on 2005/07/01 12:06:57 UTC

[jira] Created: (TAPESTRY-367) DatePicker ignores format parameter

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


[jira] Commented: (TAPESTRY-367) DatePicker ignores format parameter

Posted by "Paul Ferraro (JIRA)" <ta...@jakarta.apache.org>.
    [ 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


[jira] Resolved: (TAPESTRY-367) DatePicker ignores format parameter

Posted by "Paul Ferraro (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-367?page=all ]
     
Paul Ferraro resolved TAPESTRY-367:
-----------------------------------

    Fix Version: 4.0
     Resolution: Fixed
      Assign To: Paul Ferraro

Removed "format" parameter from DatePicker.jwc and corresponding getFormat() method in DatePicker.java

> 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
>     Assignee: Paul Ferraro
>      Fix For: 4.0

>
> 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