You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Tauren Mills (JIRA)" <ji...@apache.org> on 2010/03/02 02:30:05 UTC

[jira] Commented: (WICKET-2763) DateTimeField bug at the instant daylight savings time begins

    [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839951#action_12839951 ] 

Tauren Mills commented on WICKET-2763:
--------------------------------------

I changed the DateTimeField code in the quickstart to this:

		DateTimeField start = new DateTimeField("start", new PropertyModel<Date>(this,"start")) {
        	private static final long serialVersionUID = 1L;
			@Override
			protected TimeZone getClientTimeZone() {
				return TimeZone.getTimeZone("UTC");
			}
		};
		form.add(start);

However, it still gives an error when the hour is 2 on 3/14/2010.

> DateTimeField bug at the instant daylight savings time begins
> -------------------------------------------------------------
>
>                 Key: WICKET-2763
>                 URL: https://issues.apache.org/jira/browse/WICKET-2763
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-datetime
>    Affects Versions: 1.4.6
>            Reporter: Tauren Mills
>            Priority: Minor
>         Attachments: datetimefield_dst_bug.tgz
>
>
> I'm having troubles with an exception being thrown when using a DateTimeField.  This is only happening on 3/14/2010 when the Hour field contains a 2, regardless if it is AM or PM.  I believe this is related to daylight savings time starting at 2AM on 3/14/2010.
> Here is the exception:
> Caused by: org.joda.time.IllegalFieldValueException: Value 2 for hourOfDay is not supported: Illegal instant due to time zone offset transition: 2010-03-14T02:00:00.000 (America/Los_Angeles)
> 	at org.joda.time.chrono.ZonedChronology$ZonedDateTimeField.set(ZonedChronology.java:469)
> 	at org.joda.time.MutableDateTime.set(MutableDateTime.java:551)
> 	at org.apache.wicket.extensions.yui.calendar.DateTimeField.setDate(DateTimeField.java:236)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1132)
> I'm running in the Pacific time zone (America/Los_angeles).  I'm attaching a quickstart to demonstrate.  Run the quickstart and do the following:
> 1. Go to http://localhost:8080/ and note that the date is 3/14/2010 at 2:00PM.
> 2. Click the Update button, and note the feedback message
> 3. Change the hour to 3 and click update, note the exception that is thrown
> 4. Change the date to any other date, and you can update the hour with no problems.
> I found a Joda post that might be related:
> http://n2.nabble.com/possible-bug-in-date-parsing-td2434227.html
> As far as I'm concerned, this is critical because my application is throwing errors if my users specify 2AM or 2PM times on that date.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.