You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paul Joseph <pj...@copyright.com> on 2008/04/08 20:52:10 UTC

date bug related to leap year?

Hi,

 

I am using Cocoon 2.1.5 and it has been in Production since 2004.  I am
also using the matt-kruse java-script library including the calendar
widget. 


A user has reported a "date bug" where if specifies a date that is
between today and Feb 29, 2008, then it is saved correctly to the
database, but when retrieved, it is one day less.  

 

It does not matter if the date is entered directly into the field, or
chosen using the Matt-Kruse calendar widget and so I surmise it has
nothing to do with the Matt-Kruse date library, but I am not sure

 

Dates before Feb 29 work correctly and dates after today also work
correctly. 

 

Any ideas?

 

Thx!

Paul Joseph

 


Re: date bug related to leap year?

Posted by Paul Joseph <pj...@gmail.com>.
Joerg,

This is indeed interesting.  I will try it out and post my results.

Thank you very much--you got me out of a bind once before also, back in 
2004!

rgds
Paul
----- Original Message ----- 
From: "Joerg Heinicke" <jo...@gmx.de>
To: <us...@cocoon.apache.org>
Sent: Saturday, April 12, 2008 11:06 PM
Subject: Re: date bug related to leap year?


> On 12.04.2008 07:40, Paul Joseph wrote:
>
>> Do you know what I need to do to switch it to the JDK lib.?  Any thing to 
>> grep for that I then need to replace with its equivalent JDK call?
>
> I can't answer your questions directly right now, but I searched for ICU4J 
> on our changes page [1] and found following entries:
>
> - Version 2.1.7 (March 23 2005)
>
> CForms: separate FormattingDateConvertor that uses 
> java.text.SimpleDateFormat and Icu4jDateFormatter  that uses ICU4J. There 
> was previously an automatic switch to ICU4J if the library was present in 
> the classpath, which sometimes caused some strange results as it behaves a 
> bit differently. Committed by SW.
>
> - Version 2.1.6 (November 19 2004)
>
> The daylight time cause error when timezone is CST. Updated icu4j to 3.0. 
> Committed by AG. Thanks to Johnson Hsu. See Issue 30372.
>
> See second one might be exactly what you are looking for. It seems we 
> fixed it only by upgrading ICU4J.
>
> Hope this helps,
>
> Joerg
>
> [1] http://cocoon.apache.org/2.1/changes.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: date bug related to leap year?

Posted by Paul Joseph <pj...@gmail.com>.
Joerg,

It worked!

I updated the ICU4J lib. with the latest available and the problem has gone!

Thanks again.

If ever you are in the Boston area, please do let me know, I owe you a great 
dinner!

brgds
Paul
----- Original Message ----- 
From: "Joerg Heinicke" <jo...@gmx.de>
To: <us...@cocoon.apache.org>
Sent: Saturday, April 12, 2008 11:06 PM
Subject: Re: date bug related to leap year?


> On 12.04.2008 07:40, Paul Joseph wrote:
>
>> Do you know what I need to do to switch it to the JDK lib.?  Any thing to 
>> grep for that I then need to replace with its equivalent JDK call?
>
> I can't answer your questions directly right now, but I searched for ICU4J 
> on our changes page [1] and found following entries:
>
> - Version 2.1.7 (March 23 2005)
>
> CForms: separate FormattingDateConvertor that uses 
> java.text.SimpleDateFormat and Icu4jDateFormatter  that uses ICU4J. There 
> was previously an automatic switch to ICU4J if the library was present in 
> the classpath, which sometimes caused some strange results as it behaves a 
> bit differently. Committed by SW.
>
> - Version 2.1.6 (November 19 2004)
>
> The daylight time cause error when timezone is CST. Updated icu4j to 3.0. 
> Committed by AG. Thanks to Johnson Hsu. See Issue 30372.
>
> See second one might be exactly what you are looking for. It seems we 
> fixed it only by upgrading ICU4J.
>
> Hope this helps,
>
> Joerg
>
> [1] http://cocoon.apache.org/2.1/changes.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: date bug related to leap year?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 12.04.2008 07:40, Paul Joseph wrote:

> Do you know what I need to do to switch it to the JDK lib.?  Any thing 
> to grep for that I then need to replace with its equivalent JDK call?

I can't answer your questions directly right now, but I searched for 
ICU4J on our changes page [1] and found following entries:

- Version 2.1.7 (March 23 2005)

CForms: separate FormattingDateConvertor that uses 
java.text.SimpleDateFormat and Icu4jDateFormatter  that uses ICU4J. 
There was previously an automatic switch to ICU4J if the library was 
present in the classpath, which sometimes caused some strange results as 
it behaves a bit differently. Committed by SW.

- Version 2.1.6 (November 19 2004)

The daylight time cause error when timezone is CST. Updated icu4j to 
3.0. Committed by AG. Thanks to Johnson Hsu. See Issue 30372.

See second one might be exactly what you are looking for. It seems we 
fixed it only by upgrading ICU4J.

Hope this helps,

Joerg

[1] http://cocoon.apache.org/2.1/changes.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: date bug related to leap year?

Posted by Paul Joseph <pj...@gmail.com>.
Hi Joerg,

Thank you for your reply.

Do you know what I need to do to switch it to the JDK lib.?  Any thing to 
grep for that I then need to replace with its equivalent JDK call?

thx
Paul
----- Original Message ----- 
From: "Joerg Heinicke" <jo...@gmx.de>
To: <us...@cocoon.apache.org>
Sent: Friday, April 11, 2008 11:35 PM
Subject: Re: date bug related to leap year?


> On 10.04.2008 06:01, Paul Joseph wrote:
>
>> In short, I see this problem only for the date datatype for a field 
>> widget that is used in a repeater type widget on a Windows platform.
>
> Could it be related to the date library? As far as I know we used to use 
> or still use IBM's ICU4J but there should be an option to switch to JDK 
> library.
>
> Joerg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: date bug related to leap year?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 10.04.2008 06:01, Paul Joseph wrote:

> In short, I see this problem only for the date datatype for a field 
> widget that is used in a repeater type widget on a Windows platform.

Could it be related to the date library? As far as I know we used to use 
or still use IBM's ICU4J but there should be an option to switch to JDK 
library.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: date bug related to leap year?

Posted by Paul Joseph <pj...@gmail.com>.
Derek,

Thank you for your e-mail.

I have done more "investigation" into this and have found that:

1. The problem does not happen on Linux--only on XP and Windows 2000 V3.
2. The database ALWAYS has the correct value ex. 3/15/08 (or 15/3/08) is 
always stored as such, but displays as 3/14/08 (or 14/3/08).
3. The problem is ONLY in the repeater widget--not it always occurs where I 
am using a table, with one of the columns a field with datatype of date.  If 
I use the field widget OUTSIDE of a repeater, then the date shows there 
correctly.

In short, I see this problem only for the date datatype for a field widget 
that is used in a repeater type widget on a Windows platform.

I tried to locate "leap year code" in the CForms->formsModule section, but 
have had no luck.

I am using Cocoon 2.1.5 which came out in 2004 so am thinking that later 
versions of Cocoon may have this fixed.

So that is my next plan--upgrade and see if the problem goes away.

thx
Paul
----- Original Message ----- 
From: "Derek Hohls" <DH...@csir.co.za>
To: <us...@cocoon.apache.org>
Sent: Thursday, April 10, 2008 2:30 AM
Subject: Re: date bug related to leap year?


> Paul
>
> What happens when you try to enter this date directly into the
> database;
> I have found that MySQL, for example, "auto corrects" some date
> entries.
>
>>>> On 2008/04/08 at 08:52, in message
> <87...@mail1.copyright.com>, "Paul
> Joseph" <pj...@copyright.com> wrote:
>
> Hi,
>
> I am using Cocoon 2.1.5 and it has been in Production since 2004.  I am
> also using the matt-kruse java-script library including the calendar
> widget.
>
> A user has reported a *date bug* where if specifies a date that is
> between today and Feb 29, 2008, then it is saved correctly to the
> database, but when retrieved, it is one day less.
>
> It does not matter if the date is entered directly into the field, or
> chosen using the Matt-Kruse calendar widget and so I surmise it has
> nothing to do with the Matt-Kruse date library, but I am not sure
>
> Dates before Feb 29 work correctly and dates after today also work
> correctly.
>
> Any ideas?
>
> Thx!
> Paul Joseph
>
>
> -- 
> This message is subject to the CSIR's copyright terms and conditions, 
> e-mail legal notice, and implemented Open Document Format (ODF) standard.
> The full disclaimer details can be found at 
> http://www.csir.co.za/disclaimer.html.
>
> This message has been scanned for viruses and dangerous content by 
> MailScanner,
> and is believed to be clean.  MailScanner thanks Transtec Computers for 
> their support.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: date bug related to leap year?

Posted by Derek Hohls <DH...@csir.co.za>.
Paul

What happens when you try to enter this date directly into the
database; 
I have found that MySQL, for example, "auto corrects" some date
entries.

>>> On 2008/04/08 at 08:52, in message
<87...@mail1.copyright.com>, "Paul
Joseph" <pj...@copyright.com> wrote:

Hi,
 
I am using Cocoon 2.1.5 and it has been in Production since 2004.  I am
also using the matt-kruse java-script library including the calendar
widget. 

A user has reported a *date bug* where if specifies a date that is
between today and Feb 29, 2008, then it is saved correctly to the
database, but when retrieved, it is one day less.  
 
It does not matter if the date is entered directly into the field, or
chosen using the Matt-Kruse calendar widget and so I surmise it has
nothing to do with the Matt-Kruse date library, but I am not sure
 
Dates before Feb 29 work correctly and dates after today also work
correctly. 
 
Any ideas?
 
Thx!
Paul Joseph
 

-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org