diff options
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 14 | ||||
-rw-r--r-- | libjava/java/util/GregorianCalendar.java | 8 | ||||
-rw-r--r-- | libjava/testsuite/libjava.mauve/xfails | 1 |
3 files changed, 20 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 9211c7c..7fc6bda 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,17 @@ +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) + 2003-12-30 Michael Koch <konqueror@gmx.de> * java/io/ObjectInputStream.java, diff --git a/libjava/java/util/GregorianCalendar.java b/libjava/java/util/GregorianCalendar.java index 624924c..1d3d2f0 100644 --- a/libjava/java/util/GregorianCalendar.java +++ b/libjava/java/util/GregorianCalendar.java @@ -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; diff --git a/libjava/testsuite/libjava.mauve/xfails b/libjava/testsuite/libjava.mauve/xfails index 178a492..8caf469 100644 --- a/libjava/testsuite/libjava.mauve/xfails +++ b/libjava/testsuite/libjava.mauve/xfails @@ -34,7 +34,6 @@ FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("UTF-16BE") (numb FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("UTF-16LE") (number 1) FAIL: gnu.testlet.java.text.AttributedString.Test: Attribute key count (number 1) FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: patterns (number 2) -FAIL: gnu.testlet.java.text.SimpleDateFormat.Test: parse() strict (number 1) FAIL: gnu.testlet.java.text.SimpleDateFormat.getAndSet2DigitYearStart: get2DigitYearStart() initial (number 1) FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: invalid locale (number 1) FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: CollationElementIterator (number 1) |