SerialDate MINIMUM_YEAR_SUPPORTED question

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: SerialDate MINIMUM_YEAR_SUPPORTED question

Post by david.gilbert » Mon Jun 15, 2009 10:32 pm

It probably wouldn't be hard to make SerialDate go further back in time, just by using negative values. The first problem you'd run into is how to handle the screwy dates in the 1700's when the calendars changed around, but then you're only looking to support dates from the 1800's so that wouldn't matter. I'll probably take a look at this in the next week or two, because it is a dumb limitation.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

schnirkel
Posts: 2
Joined: Mon Jun 15, 2009 10:18 pm

Re: SerialDate MINIMUM_YEAR_SUPPORTED question

Post by schnirkel » Tue Jun 16, 2009 4:43 pm

Would be great if you could have a look at it. I'll get the sources and play around with SerialDate as well, maybe I can provide a patch.

Thanks,
Tom

jeffmc
Posts: 1
Joined: Fri Oct 30, 2009 10:09 pm
antibot: No, of course not.

Re: SerialDate MINIMUM_YEAR_SUPPORTED question

Post by jeffmc » Fri Oct 30, 2009 10:11 pm

We too are seeing the same problem. Basically if you create a Millisecond object with an older date you get the problem:

The 'year' argument must be in range 1900 to 9999.
java.lang.IllegalArgumentException: The 'year' argument must be in range 1900 to 9999.
at org.jfree.date.SpreadsheetDate.<init>(SpreadsheetDate.java:114)
at org.jfree.date.SerialDate.createInstance(SerialDate.java:795)
at org.jfree.data.time.Day.<init>(Day.java:193)
at org.jfree.data.time.Millisecond.<init>(Millisecond.java:183)
at org.jfree.data.time.Millisecond.<init>(Millisecond.java:151)

I believe we are running with the latest release from April 20, 2009

Any ideas for a workaround?

Thanks,
jeff

Locked