Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/phillbush/calendar

print upcoming events
https://github.com/phillbush/calendar

awk calendar unix

Last synced: 15 days ago
JSON representation

print upcoming events

Awesome Lists containing this project

README

        

calendar

Calendar reads files for events, one event per line; and write to
standard output those events ocurring in the next seven days (counting
from today).

Each event should begin with a date pattern in the format
[[YYYY-[MM]]-DDWW[+N|-N]. The hyphen (-) that separates the values can
be replaced by a slash (/) or a period (.). Several date patterns can
be supplied separated by a comma (,).

YYYY should be any year number. MM should be a month number or a month
name (either complete or abbreviate, such as "April" or "Apr"). DD
should be the number of a day in the month. WW should be the name of a
day in the week (either complete or abbreviate). Either DD or WW (or
both) must be supplied.

The date pattern can be followed by +N or -N to specify the week on the
month (for example Sun+2 is the second Sunday in the month, Mon-3 is
the third from last Monday in the month).

For example, consider the following input.

# holidays
01/01 New Year's day
05/01 Labor Day
07/25 Generic holiday
12/25 Christmas
May/Sun+2 Mother's day
13Fri Friday the 13th

# classes
Mon,Wed Java Class
Tue,Thu Algebra Class
Tue,Thu Operating Systems Class
Tue,Thu Computer Network Class

If today were 09 March 2021, then running calendar on this input would
print the following:

Sunday 09 May 2021
Mother's day
Monday 10 May 2021
Java Class
Tuesday 11 May 2021
Algebra Class
Computer Network Class
Operating Systems Class
Wednesday 12 May 2021
Java Class
Thursday 13 May 2021
Algebra Class
Computer Network Class
Operating Systems Class
Friday 14 May 2021
Saturday 15 May 2021

This software is in public domain and is provided AS IS, with NO WARRANTY.