You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christian Mittendorf <ch...@freenet.de> on 2006/03/08 13:25:37 UTC

How to format a date within an error message?

Hello!

I'd like to specify a format for a date object within an error message.

  <binding name="validators" value="validators:mindays=7[%date-too- 
early],maxdays=14[%date-too-late]"/>

The mindays or maxdays error message passes a date object as  
parameter {1} to these messages:

  date-too-early=Der früheste Zeitpunkt kann der {1} sein.
  date-too-late=Der späteste Zeitpunkt kann der {1} sein.

However, on the page this message evaluates to

  Der früheste Zeitpunkt kann der 3/15/06 12:00 AM sein.

How can I specify the format of the date?

Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to format a date within an error message?

Posted by Christian Mittendorf <ch...@freenet.de>.
Am 08.03.2006 um 13:25 schrieb Christian Mittendorf:

>  date-too-early=Der früheste Zeitpunkt kann der {1} sein.
>  date-too-late=Der späteste Zeitpunkt kann der {1} sein.

Ok, sometimes it's too easy and I'm too blind to see...

http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html

...does explain everything ;-)

Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org