Re: [T5] How to format java.lang.Date when using expansion

2008-01-04 Thread Chris Lewis
As you can see, there's a lot of options, and on that note I'll add one 
more. You can use the DateFormat component, which is part of  this 
component library: http://code.google.com/p/gc-tapestry-components/.


It has the disadvantage of providing a specific function, as opposed to 
Output/OutputLocaleNumber which handle various situations. This 
limitation, on the other hand, makes it easier to use:




Just pass it a date (article.created is a page property) and a date 
format as supported by java's SimpleDateFormat, and that's all.


chris

Dapeng wrote:

hi guys

i am using expansion to output a Date object like


   Your last login: ${lastLoginDate}



but how to format it ?? currently it gives the whole string as Wed Dec 
12 18:36:38 SGT 2007


how to change it to like dd/mm/???











regards

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] How to format java.lang.Date when using expansion

2007-12-17 Thread Davor Hrg
you could add you own binding prefix

${date:lastLoginDate}

or

${date:lastLoginDate}

http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefix

Davor Hrg


On Dec 13, 2007 7:17 AM, Liu Dapeng <[EMAIL PROTECTED]> wrote:
> hi guys
>
>  i am using expansion to output a Date object like
>
>
>  Your last login: ${lastLoginDate}
>
>
>
>  but how to format it ?? currently it gives the whole string as Wed
> Dec 12 18:36:38 SGT 2007
>
>  how to change it to like dd/mm/???
>
>
>
>
>
>
>
>
>
>
>
>  regards
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] How to format java.lang.Date when using expansion

2007-12-13 Thread Marcus
Hi Dapeng,

OutputLocale
http://wiki.apache.org/tapestry/Tapestry5OutputLocaleNumber

Marcus


Re: [T5] How to format java.lang.Date when using expansion

2007-12-13 Thread Filip S. Adamsen

Hi Dapeng,

Consider adding the message format binding prefix to your application.

http://wiki.apache.org/tapestry/Tapestry5HowToAddMessageFormatBindingPrefix

It does what you want and it's easy to localize the date format.

-Filip

Dapeng skrev:

hi guys

i am using expansion to output a Date object like


   Your last login: ${lastLoginDate}



but how to format it ?? currently it gives the whole string as Wed Dec 
12 18:36:38 SGT 2007


how to change it to like dd/mm/???











regards

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[T5] How to format java.lang.Date when using expansion

2007-12-13 Thread Liu Dapeng
hi guys

 i am using expansion to output a Date object like


 Your last login: ${lastLoginDate}



 but how to format it ?? currently it gives the whole string as Wed
Dec 12 18:36:38 SGT 2007

 how to change it to like dd/mm/???











 regards

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] How to format java.lang.Date when using expansion

2007-12-13 Thread Angelo Chen

try the outputlocale component in the howtowiki page, it works very well:




dapeng-2 wrote:
> 
> hi guys
> 
>  i am using expansion to output a Date object like
> 
> 
> Your last login: ${lastLoginDate}
> 
> 
> 
>  but how to format it ?? currently it gives the whole string as Wed Dec 
> 12 18:36:38 SGT 2007
> 
>  how to change it to like dd/mm/???
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  regards
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-T5--How-to-format-java.lang.Date-when-using-expansion-tp14312035p14312705.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] How to format java.lang.Date when using expansion

2007-12-13 Thread Geoff Callender

Try the Output component, eg.



with some extra java for the format:

	private DateFormat _dateViewFormat = new SimpleDateFormat("dd/MM/ 
");


public DateFormat getDateViewFormat() {
return _dateViewFormat;
}

Cheers,

Geoff

On 13/12/2007, at 7:38 PM, Dapeng wrote:


hi guys

i am using expansion to output a Date object like


  Your last login: ${lastLoginDate}



but how to format it ?? currently it gives the whole string as Wed  
Dec 12 18:36:38 SGT 2007


how to change it to like dd/mm/???











regards

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





[T5] How to format java.lang.Date when using expansion

2007-12-13 Thread Dapeng

hi guys

i am using expansion to output a Date object like


   Your last login: ${lastLoginDate}



but how to format it ?? currently it gives the whole string as Wed Dec 
12 18:36:38 SGT 2007


how to change it to like dd/mm/???











regards

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]