This is the fourth of the series.
Date.getDate() will return 7 when today is Sunday, it's semantically wrong
according to Java library documentation. It should return 0.
The DAY_OF_WEEK value is set in GregorianCalendar:
private void calculateDay(int day, boolean gregorian)
{
// the epoch is a Thursday.
int weekday = (day + THURSDAY) % 7;
if (weekday <= 0) <- notice here.
weekday += 7; <- notice here.
fields[DAY_OF_WEEK] = weekday;
... ...
}
But there seems to be problems to change in GregorianCalendar.java, so I made
a patch in Date.java:
- return cal.get(Calendar.DAY_OF_WEEK);
+ int day = cal.get(Calendar.DAY_OF_WEEK);
+ return day == 7?0:day;
_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath