You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Suarez <Su...@jobcorps.org> on 2004/10/05 14:55:05 UTC

textbox format date & i18n date handling

Multiple related questions:

1)  I have a java.util.Date field that needs to be displayed in a
textbox.  In bean:write there are formatting methods to have the date
display using a MM/dd/yyyy for example.  however I don't see the same
for html:text.  I'm sure there's a way I'm not seeing...  I tried
putting the bean:write in between the html:text tags hoping it would
render the formatted date but I couldn't write html:text with no
property item and using an empty space didn't work.

I was thinking about using a ConvertUtils String and Date conversion
methods to only show the format that I wanted in this case but these are
static methods and I can say for certain that there will be a case where
I would want the Date formatted with the time portion as well.

2)  We have an i18n app where the date should be displayed/set as used
locally.  The ConvertUtils method again would restrict to one date
format so what I am thinking for i18n is to populate it into a hidden
field (US Format always) and use javascript to do the formatting for the
user view and to update the hidden field again so struts only needs to
worry about one date format on submit.  Seems like a lot of work though,
I would think other's have run into this as well.  What's the better
solution that I'm not seeing?

Thanks for your assistance.

Regards...djsuarez




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