Coder Social home page Coder Social logo

frossm / cal Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 8.86 MB

Command line calendar display with holidays

Home Page: https://github.com/frossm/cal

License: MIT License

Java 96.41% Python 3.28% Shell 0.31%
snap cal jar calendars java calendar date fatjar command-line command-line-tool

cal's Introduction

cal - The Console Calendar Generator

Cal (or fCal on SNAP) is a command line utility that will output a calendar for the desired month/year. It's simple and accurate with a few useful features.

By default, Cal will display the current year. You can provide a month and year, a month, or just a year. You can also change the number of calendars per row in your display with the -n switch. See the examples below for a more through description.

Cal also will show local holidays for many countries. It's activated via the -d switch. A list of supported countries can be found at https://date.nager.at/Country

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.
-d Display local county holidays in the calendar
-c Clear the holiday cache on the local computer and exit. The next time they are needed they will be downloaded from the Internet
-v Display the current version and copyright of the program and exit. -v will also query GitHub and display the latest release version.
-z Disable colored output
-h or -? Display the help page

Parameters

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

Parameter Description
Year Display the provided year
Month Display the current month in the current year
Month Year Display the current month in the provided year
If no parameter is given, display the current 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 java must be in your path and this assumes cal.jar is in your current directory. Basic command line topics and I won't go into detail here.

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

SNAP

fcal

I would encourage anyone with a supported Linux platform to use snap. See Snapcraft Homepage for more information. You can download, install, and keep Cal up to date automatically by installing the snap via :

sudo snap install fcal (Assuming snap is installed)

I had to call it fcal as cal was already taken.

This will install the application into a sandbox where it is separate from other applications. I do want to look at packaging it via Flatpak as well, but my understanding is that Maven is not well supported. However, I need to do more investigation.

Get it from the Snap Store

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:

License

The MIT License

Copyright (C) 2019-2022 by Michael Fross

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cal's People

Contributors

frossm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.