Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue #167 and issue #165 #259

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/main/java/org/jfree/chart/date/SpreadsheetDate.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
* Represents a date using an integer, in a similar fashion to the
* implementation in Microsoft Excel. The range of dates supported is
* 1-Jan-1900 to 31-Dec-9999.
* (This year limit is removed to support years
* earlier than 1990, which is currently supported in Microsoft Excel.)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Just remove the last sentence (starting on line 43 and ending on 44) - then no need for adding lines 45 and 46.

* <P>
* Be aware that there is a deliberate bug in Excel that recognises the year
* 1900 as a leap year when in fact it is not a leap year. You can find more
Expand Down Expand Up @@ -85,13 +87,8 @@ public class SpreadsheetDate extends SerialDate {
*/
public SpreadsheetDate(int day, int month, int year) {

if ((year >= 1900) && (year <= 9999)) {
this.year = year;
}
else {
throw new IllegalArgumentException(
" in range 1900 to 9999.");
}
// CS427 Issue link: https://github.com/jfree/jfreechart/issues/165
this.year = year;

if ((month >= MonthConstants.JANUARY)
&& (month <= MonthConstants.DECEMBER)) {
Expand Down
Loading