[kaffe] Re: GregorianCalendar fixes

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


--=-2lx3b1HkZe/XqSkgByM0
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

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=
 ;)
>=20
> 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);
       }
 =20
-    fields[DAY_OF_WEEK_IN_MONTH] =3D (fields[DAY_OF_MONTH] + 12) / 7;
+    fields[DAY_OF_WEEK_IN_MONTH] =3D (fields[DAY_OF_MONTH] + 6) / 7;
 =20
     // which day of the week are we (0..6), relative to getFirstDayOfWeek
     int relativeWeekday =3D (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@kaffe.org>
>=20
>   	* 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 =3D fields[HOUR];
> >          if (isSet[AM_PM] && fields[AM_PM] =3D=3D PM)
> > -	  hour +=3D 12;
> > +	  if (hour !=3D 12) /* not Noon */
> > +            hour +=3D 12;
> > +	/* Fix the problem of the status of 12:00 AM (midnight). */
> > +	if (isSet[AM_PM] && fields[AM_PM] =3D=3D AM && hour =3D=3D 12)
> > +	  hour =3D 0;
> >        }
> > =20
> >      int minute =3D isSet[MINUTE] ? fields[MINUTE] : 0;

Cheers,

Mark

--=-2lx3b1HkZe/XqSkgByM0
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQA/7FF5xVhZCJWr9QwRAkVGAJ9oFvVK+g5BxVY9gL7L7ixbgYDStwCfSOEL
k0QYzxWCR+kRzyFjxO4MuT8=
=P+/c
-----END PGP SIGNATURE-----

--=-2lx3b1HkZe/XqSkgByM0--