I think I've found a pretty major bug in the 'private int calcSerial(final int d, final int m, final int y)' function of the SpreadsheetDate class in the jcommon library.
if (m > MonthConstants.FEBRUARY) {
should be replaced with either:
if (m >= MonthConstants.FEBRUARY) {
or
if (m > 1) {
Maybe something like this:
public static int calcSerial(final int d, final int m, final int y)
{
final int yy = ((y - 1900) * 365) + SerialDate.leapYearCount(y - 1);
int mm = AGGREGATE_DAYS_TO_END_OF_PRECEDING_MONTH[m];
if (m > 1 && SerialDate.isLeapYear(y))
return yy + mm + d + 2;
return yy + mm + d + 1;
}
Cheers, Bob
Bug
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Bug
I don't think this is a bug - see my comments on the bug report:
https://sourceforge.net/tracker/?func=d ... tid=115494
https://sourceforge.net/tracker/?func=d ... tid=115494
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

