You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Inkwon Hwang <in...@gmail.com> on 2008/04/30 14:36:29 UTC

Struts2, DateTimePicker gives 1970

Environment
Java5
Jboss 4.0.5 and WAS 6.1 Express
Struts 2.1.1
Tiles 2.0.5

Code
added
<sx:head /> 
and
<sx:datetimepicker name="endDate" displayFormat="dd.MM.yyyy"/>

Issue
When I insert not-valid date value (i.e. "aaa") and set focus to other
textfield, I get "01.01.1970" to the textfield.
I have read about DateTimePicker issues from Struts2 issue tracker Jira
(https://issues.apache.org/struts/browse/WW-1997) and probably this is known
issue.

Questions
Could some tell me, when this will be fixed?
If not, do you know any work around for example there would be no value if
input is invalid?

Example
my input
http://www.nabble.com/file/p16981446/input_DTPicker.png 

my result
http://www.nabble.com/file/p16981446/value_DTPicker.png 

-- 
View this message in context: http://www.nabble.com/Struts2%2C-DateTimePicker-gives-1970-tp16981446p16981446.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts2, DateTimePicker gives 1970

Posted by Inkwon Hwang <in...@gmail.com>.
Hi Jim,
Thanx for your reply. 
Desired options could be:
1. leave entered value -> validation is done on server side
2. remove entered value -> validation is done on server side

It seems weird that suddenly the field has value "01.01.1970" eventhough it
makes sense for developers but it doesn't for non-technical users.
br
Inkwon


Jim Kiley wrote:
> 
> What would be the desired behavior when a non-date value is entered?
> 1/1/1970 corresponds to a 'zero' value for dates.  This seems like a
> sensible response.
> -- 
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Struts2%2C-DateTimePicker-gives-1970-tp16981446p16981930.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts2, DateTimePicker gives 1970

Posted by Jim Kiley <jh...@summa-tech.com>.
What would be the desired behavior when a non-date value is entered?
1/1/1970 corresponds to a 'zero' value for dates.  This seems like a
sensible response.

On Wed, Apr 30, 2008 at 8:36 AM, Inkwon Hwang <in...@gmail.com>
wrote:

>
> Environment
> Java5
> Jboss 4.0.5 and WAS 6.1 Express
> Struts 2.1.1
> Tiles 2.0.5
>
> Code
> added
> <sx:head />
> and
> <sx:datetimepicker name="endDate" displayFormat="dd.MM.yyyy"/>
>
> Issue
> When I insert not-valid date value (i.e. "aaa") and set focus to other
> textfield, I get "01.01.1970" to the textfield.
> I have read about DateTimePicker issues from Struts2 issue tracker Jira
> (https://issues.apache.org/struts/browse/WW-1997) and probably this is
> known
> issue.
>
> Questions
> Could some tell me, when this will be fixed?
> If not, do you know any work around for example there would be no value if
> input is invalid?
>
> Example
> my input
> http://www.nabble.com/file/p16981446/input_DTPicker.png
>
> my result
> http://www.nabble.com/file/p16981446/value_DTPicker.png
>
> --
> View this message in context:
> http://www.nabble.com/Struts2%2C-DateTimePicker-gives-1970-tp16981446p16981446.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com