lunes, 11 de octubre de 2010

s:convertDateTime

s:convertDateTime

In the Seam documentation there is very little information about this tag.
In the documentation, there is only one example:
     h:outputText> 

This doesn't really say much. However, after some googling, I can explain some of the attributes, and what is actually useful to use.
If you want to show both date and time: dd-MM-yyyy hh:mm:ss you can use type="both" and dateStyle="full". If you want to show only date. Use type="date".

You choose from a range of different dateStyle.
default May 14, 2007 2:35:45 PM ( Default Value)
short 5/14/07 12:55:42 PM
medium May 14, 2007 2:42:36 PM
long May 14, 2007 2:41:08 PM
full Monday, May 14, 2007 2:39:56 PM


However what I have found the most useful is just to use the pattern attribute together with the type.
So if you want the style 14.07.2009 you just write

     h:outputText>
And you are set to go!

fuente

Documentacion:

http://docs.jboss.org/seam/2.1.2/reference/en-US/pdf/seam_reference.pdf
33.1.2. Converters and Validators