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 01:16:05 UTC

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

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: Blocker


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.


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

Posted by "Tauren Mills (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tauren Mills updated WICKET-2763:
---------------------------------

    Attachment: datetimefield_dst_bug.tgz

QuickStart that demos the problem.

> 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: Blocker
>         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.


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

Posted by "Tauren Mills (JIRA)" <ji...@apache.org>.
    [ 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.


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

Posted by "Jim Pinkham (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925591#action_12925591 ] 

Jim Pinkham commented on WICKET-2763:
-------------------------------------

Just got a user report of error trying to enter "3/13/2011 2:00 PM" in a DateTimeField and it led me to this issue.   Work around of using military time isn't feasible.  I told em to enter 1:59 PM for now.

I'm still using wicket 1.3.7 - will upgrading to 1.4 resolve this?  If not, what can I do? 

> 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
>            Assignee: Igor Vaynberg
>            Priority: Minor
>         Attachments: datetimefield_dst_bug.tgz, datetimefield_dst_bug_partially_fixed.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.


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

Posted by "Stephen Colebourne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840163#action_12840163 ] 

Stephen Colebourne commented on WICKET-2763:
--------------------------------------------

There are two basic approaches to the workaround at the Joda-Time level:

1) Parse in UTC, then switch to the right time zone

2) Set the default MutableDateTime to the afternoon (eg midday) before parsing the hour and am/pm using fomatter.parseInto()


> 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, datetimefield_dst_bug_partially_fixed.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.


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

Posted by "Tauren Mills (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tauren Mills updated WICKET-2763:
---------------------------------

    Attachment: datetimefield_dst_bug_partially_fixed.tgz

Quickstart where I've copied DateTimeField and made some changes to convertInput() and setDate().

I think the convertInput() changes are working, but I haven't been able to figure out what should be done in setDate().



> 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, datetimefield_dst_bug_partially_fixed.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.


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839983#action_12839983 ] 

Igor Vaynberg edited comment on WICKET-2763 at 3/2/10 2:57 AM:
---------------------------------------------------------------

setdate() is public and its not using any private methods...

      was (Author: ivaynberg):
    setdata is public and its not using any private methods...
  
> 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, datetimefield_dst_bug_partially_fixed.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.


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

Posted by "Tauren Mills (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839979#action_12839979 ] 

Tauren Mills edited comment on WICKET-2763 at 3/2/10 2:35 AM:
--------------------------------------------------------------

I believe the problem is in both convertInput() and in setDate().

In convertInput():

	date.set(DateTimeFieldType.hourOfDay(), hours.intValue() %
			getMaximumHours(use12HourFormat));

In setDate():

	this.date.set(DateTimeFieldType.hourOfDay(), hours.intValue() %
			(use12HourFormat ? 12 : 24));

The problem is that even if the time is 2:00PM, the hourOfDay field is set to 2 instead of 14.  The value of halfdayOfDay() is set afterwards. The hour 2 doesn't exist on 3/14/2010.  Because of this, the exception is thrown immediately when hourOfDay is set to 2.

I cannot override these methods with my own implementation because they both refer to private members that don't have getters or setters (hoursField, minutesField, amOrPmChoice, etc.)

The only solution would be to create my own copy of DateTimeField with the fixes.  I tried to fix it, and think I did in convertInput, but I'm having troubles with setDate(). If I figure it out, I'll post details.


      was (Author: tauren):
    I believe the problem is in both convertInput() and in setDate().

In convertInput():

	date.set(DateTimeFieldType.hourOfDay(), hours.intValue() %
			getMaximumHours(use12HourFormat));

In setDate():

	this.date.set(DateTimeFieldType.hourOfDay(), hours.intValue() %
			(use12HourFormat ? 12 : 24));

The problem is that even if the time is 2:00PM, the hourOfDay field is set to 2 instead of 14.  The value of halfdayOfDay() is set afterwards. The hour 2 doesn't exist on 3/14/2010.

I cannot override these methods with my own implementation because they both refer to private members that don't have getters or setters (hoursField, minutesField, amOrPmChoice, etc.)

The only solution would be to create my own copy of DateTimeField with the fixes.  I tried to fix it, and think I did in convertInput, but I'm having troubles with setDate(). If I figure it out, I'll post details.

  
> 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.


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

Posted by "Tauren Mills (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839979#action_12839979 ] 

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

I believe the problem is in both convertInput() and in setDate().

In convertInput():

	date.set(DateTimeFieldType.hourOfDay(), hours.intValue() %
			getMaximumHours(use12HourFormat));

In setDate():

	this.date.set(DateTimeFieldType.hourOfDay(), hours.intValue() %
			(use12HourFormat ? 12 : 24));

The problem is that even if the time is 2:00PM, the hourOfDay field is set to 2 instead of 14.  The value of halfdayOfDay() is set afterwards. The hour 2 doesn't exist on 3/14/2010.

I cannot override these methods with my own implementation because they both refer to private members that don't have getters or setters (hoursField, minutesField, amOrPmChoice, etc.)

The only solution would be to create my own copy of DateTimeField with the fixes.  I tried to fix it, and think I did in convertInput, but I'm having troubles with setDate(). If I figure it out, I'll post details.


> 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.


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839983#action_12839983 ] 

Igor Vaynberg commented on WICKET-2763:
---------------------------------------

setdata is public and its not using any private methods...

> 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, datetimefield_dst_bug_partially_fixed.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.


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2763.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

problem is in joda lib

> 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
>            Assignee: Igor Vaynberg
>            Priority: Minor
>         Attachments: datetimefield_dst_bug.tgz, datetimefield_dst_bug_partially_fixed.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.


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925922#action_12925922 ] 

Igor Vaynberg commented on WICKET-2763:
---------------------------------------

@jim, the problem is in joda time not in our code. you should ask them how to fix it. other then that see stephen's comment and see if that helps you figure out a sollution.

> 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
>            Assignee: Igor Vaynberg
>            Priority: Minor
>         Attachments: datetimefield_dst_bug.tgz, datetimefield_dst_bug_partially_fixed.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.


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-2763:
----------------------------------

    Priority: Minor  (was: Blocker)

> 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.


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

Posted by "Tauren Mills (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840078#action_12840078 ] 

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

A quick solution to the 2PM problem is to just use 24 hour time.  The exception still happens with 2AM times, but for my app, this isn't a big deal:

		DateTimeField start = new DateTimeField("start", new PropertyModel<Date>(this,"start")) {
			@Override
			protected boolean use12HourFormat() {
				return false;
			}
		};
		form.add(start);

Igor -- thanks, your right about setDate(). But convertInput() uses private fields.

> 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, datetimefield_dst_bug_partially_fixed.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.