[multiple changes]
2003-12-30 Guilhem Lavaux <guilhem@kaffe.org> * java/util/GregorianCalendar.java (computeFields): Reported by Ito Kazumitsu <kaz@maczuka.gcd.org>. Fixed the computation of DAY_OF_WEEK_IN_MONTH. (computeTime): 12:00 midnight is AM and 12:00 noon is PM. 2003-12-30 Michael Koch <konqueror@gmx.de> * testsuite/libjava.mauve/xfails: Removed the following testcase because it passes now: FAIL: gnu.testlet.java.text.SimpleDateFormat.Test: parse() strict (number 1) From-SVN: r75244
This commit is contained in:
parent
9a706ec713
commit
cca9b4b54d
3 changed files with 20 additions and 3 deletions
|
@ -402,7 +402,11 @@ public class GregorianCalendar extends Calendar
|
|||
{
|
||||
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;
|
||||
|
@ -606,7 +610,7 @@ public class GregorianCalendar extends Calendar
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue