Skip to content

Commit

Permalink
Fixed crash with provided month and -d
Browse files Browse the repository at this point in the history
  • Loading branch information
frossm committed Dec 12, 2023
1 parent 8790473 commit 1260730
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.fross</groupId>
<artifactId>cal</artifactId>
<version>2.5.4</version>
<version>2.5.5</version>
<packaging>jar</packaging>

<name>cal</name>
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: fcal
version: '2.5.4'
version: '2.5.5'
summary: Command line calendar display
description: |
fCal is a command line calendar utility. It will display a
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/org/fross/cal/Calendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@ public static void printYear(int year) {
Output.debugPrintln(" 1 2 3 4 5 6 7 8 9 1\n"
+ "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");

if (Holidays.queryHolidaysEnabled() == true) {
holidayList = Holidays.getHolidays(year);
}

// Loop through the calendar rows
for (i = 0; i < 12; i = i + calsPerRow) {
// Initialize the arrays
Expand Down Expand Up @@ -277,6 +273,11 @@ public static String[] getCalDays(int month, int year) {
daysInMonth[2] = 29;
}

// If Display Holidays is enabled get the information
if (Holidays.queryHolidaysEnabled() == true) {
holidayList = Holidays.getHolidays(year);
}

// Determine the which day of the week the 1st fall upon
int firstDayOfMon = getDayOfWeek(month, 1, year);
Output.debugPrintln("Firstday for " + month + "/" + year + ": " + firstDayOfMon);
Expand Down

0 comments on commit 1260730

Please sign in to comment.