[kaffe] Re: GregorianCalendar fixes

Mark Wielaard mark at klomp.org
Fri Dec 26 07:21:02 PST 2003


Hi,

On Sat, 2003-11-29 at 20:15, Dalibor Topic wrote:
> 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?

I'll check this in while I am resyncing with kaffe.
There is only one functional change left between kaffe and classpath in
computeFields():

@@ -606,7 +611,7 @@
        calculateDay(++day, gregorian);
       }
  
-    fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 12) / 7;
+    fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 6) / 7;
  
     // which day of the week are we (0..6), relative to getFirstDayOfWeek
     int relativeWeekday = (7 + fields[DAY_OF_WEEK] - getFirstDayOfWeek()) % 7;

Haven't looked at who is right here, so won't merge.

> 2003-11-29  Guilhem Lavaux <guilhem at kaffe.org>
> 
>   	* java/util/GregorianCalendar.java (computeTime):
>   	12:00 midnight is AM and 12:00 noon is PM.
> [...]
> > --- 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;

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://kaffe.org/pipermail/kaffe/attachments/20031226/08c3f50c/attachment-0002.pgp 


More information about the kaffe mailing list