classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GregorianCalendar fixes


From: Dalibor Topic
Subject: Re: GregorianCalendar fixes
Date: Sat, 29 Nov 2003 20:15:08 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

Hi Ito,

after the discussion on the Classpath mailing list, I'd say it looks good ;)

Mark, can I check it into Classpath's CVS with an updated ChangeLog entry?

2003-11-29  Guilhem Lavaux <address@hidden>

        * java/util/GregorianCalendar.java (computeTime):
        12:00 midnight is AM and 12:00 noon is PM.

cheers,
dalibor topic

Ito Kazumitsu wrote:
Hi,


":" == Mark Wielaard <address@hidden> writes:


:> Looked some more at the code and I see now that the the first change was
:> inside a if (time >= gregorianCutover) so it now makes more sense to me.
:> And the second change seems correct given the above remark.
:> I'll commit it in Classpath.

There is another difference between GNU Classpath's
java/util/GregorianCalendar.java and that of kaffe.

Kaffe's was imported from GNU Classpath and modified
in the kaffe world, as described by the following
ChangeLog entry.

2003-08-16  Guilhem Lavaux <address@hidden>

        * java/util/GregorianCalendar.java (computeTime):
        12:00 midnight is AM and 12:00 noon is PM.

Here is the patch that can be applied to Revision 1.21:

--- java/util/GregorianCalendar.java.orig       Thu Nov 27 15:35:08 2003
+++ java/util/GregorianCalendar.java    Thu Nov 27 15:48:25 2003
@@ -402,7 +402,11 @@
       {
        hour = fields[HOUR];
         if (isSet[AM_PM] && fields[AM_PM] == PM)
-         hour += 12;
+         if (hour != 12) /* not Noon */
+            hour += 12;
+       /* Fix the problem of the status of 12:00 AM (midnight). */
+       if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12)
+         hour = 0;
       }
int minute = isSet[MINUTE] ? fields[MINUTE] : 0;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]