[go: up one dir, main page]

Menu

Tree [f7b133] v2019.04.15 /
 History

HTTPS access


File Date Author Commit
 .settings 2019-08-29 Michael Fross Michael Fross [e0fca6] Tweaked project to use java 12 instead of 10 as...
 src 2019-09-03 Michael Fross Michael Fross [3f2578] Still trying to get Calendar to compile with th...
 .classpath 2019-08-29 Michael Fross Michael Fross [e0fca6] Tweaked project to use java 12 instead of 10 as...
 .project 2019-02-05 Michael Fross Michael Fross [f8e9b9] Initial load. Lots of work to do (command line...
 LICENSE.txt 2019-08-24 Michael Fross Michael Fross [ed45d9] Added LICENSE.txt file which contains the GPLv3...
 README.md 2019-04-23 Michael Fross Michael Fross [a1fbdb] README.md edited online with Bitbucket
 pom.xml 2019-09-03 Michael Fross Michael Fross [f7b133] Ok, more mucking with the POM file to get the j...

Read Me

cal - The Console Calendar Generator

I had need of a simple program that could display a calendar when I'm working on the command line. This small program fits my needs and I'm hopeful it may be useful to others.

Command Line Options

Option Description
-n # Set the number of calendars per row when displaying a year. The default is 3.
-D Start in Debug Mode which will display additional debugging data. Normally not used.
-h or -? Display the help page

Parameters

Parameters are the arguments provided to the program. They do not include the options above.

Parameter Description
If no parameter is given, display the current year
Year Display the provided year
Month Display the current month in the current year
Month Year Display the current month in the provided year

Execution

This is a java program that is all bundled into a single jar file. To run a jar file on the command line, simply type:

java -jar cal.jar

Please note that cal.jar must be in your path.

Examples

Command|Result
---|---|
java -jar cal.jar | Display the current year
java -jar cal.jar -n 4 | Display the current year - 4 months per row
java -jar cal.jar 9 | Display September of the current year
java -jar cal.jar 2022 | Display the entire year 2022
java -jar cal.jar 9 2022 | Display September of 2022
java -jar cal.jar -D 6 | Display June of current year in debug mode
java -jar cal.jar -h | Show this help information

References

I was able to use several web pages for sources of formulas for the program. These were very helpful and I'd like to thank their authors for taking the time to record them publicly.

Determine how to calculate the first day of a month given the month and year:

Calculate if the year provided is a leap year: