struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolás Pace" <nicop...@gmail.com>
Subject Re: S2: datetimepicker and multiple date formats
Date Wed, 13 Jun 2007 03:46:54 GMT
On 6/12/07, Scott Nesbitt <scottnesbitt@yahoo.com> wrote:
>
> I have this code:
>
> <s:datetimepicker id="selectedDate"
>                   name="selectedDate"
>                   displayWeeks="5"
>                   displayFormat= "MM-dd-yyyy"
>
>
>
> value="%{userDetailsBean.selectDateString}"/>
>
> It works fine if the user uses the drop-down or types
> in a date in just the right format.  However, we would
> like the following to work better:
>
> user input   actual value                 desired
> value
> ----------   ------------
> -------------
> 06-12-07     NaN-NaN-0NaN                 06-12-2007
> 06/13/2007   06-12-2007  (refused change) 06-13-2007
> 06 13 2007   06-12-2007  (refused change) 06-13-2007
> etc.
>
> Basically, I would like to allow multiple date formats
> in order to make life easier for my users.
>
> Can I intercept the user input somehow before it goes
> to the validation and fix it up?
>

Scott,
Struts 2 automatically uses de correct locale information based in the
host's information.
You don't have to worry about it, unless you wan't to force it.
The best thing to do is to hope that users will configure correctly
their desktops so Struts can use that information correctly.
I hope this could help you
Bye

nicolás Pace
> Thanks,
>
> Scott
>
>
>
>
> ____________________________________________________________________________________
> Sucker-punch spam with award-winning protection.
> Try the free Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/features_spam.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Mime
View raw message