CALENDAR(1)

๐Ÿ’– CALENDAR(1) โ€” the reminder service ๐Ÿ’–

okay so bestie, welcome to calendar, the lil utility that remembers stuff so you don't have to. it's from the General Commands Manual section, and yes, it's giving "your mom's fridge calendar but make it Unix." let's get into it ๐Ÿ—“๏ธโœจ


๐ŸŒธ NAME ๐ŸŒธ

calendar โ€” reminder service


โœจ SYNOPSIS โœจ

calendar [-abw] [-A num] [-B num] [-l num] [-e num] [-f calendarfile]
         [-t [[[cc]yy]mm]dd]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so like, the calendar utility goes and checks the current directory โ€” or whatever directory you told it about with the CALENDAR_DIR environment variable โ€” looking for a file literally named calendar, and then it prints out the lines that start with today's date or tomorrow's date. and on Fridays? it's feeling generous, so it shows you everything from Friday all the way through Monday. weekend mode unlocked ๐Ÿ”“๐ŸŽ‰

๐ŸŽ€ the options ๐ŸŽ€

  • -A num โ€” prints lines from today and the next num days (forward, future vibes). defaults to one (same as -l).
  • -a โ€” processes the "calendar" files of all users and mails the results to them. this one needs superuser privileges, so like, know your power before you use it.
โš ๏ธ fr fr, this requires superuser privileges. don't just yolo it.
  • -B num โ€” prints lines from today and the previous num days (backward, looking back, nostalgic era).
  • -b โ€” enforces special date calculation mode for Cyrillic calendars.
  • -l num โ€” prints lines from today and the next num days (forward, future). defaults to one (same as -A).
  • -e num โ€” prints lines from today and the next num days, but only if today is Friday (forward, future). defaults to two, which makes calendar print entries through the weekend on Fridays. slay.
  • -f calendarfile โ€” uses calendarfile as the default calendar file. if that file isn't accessible, the system-wide default gets used instead.
  • -t [[[cc]yy]mm]dd โ€” acts like the value you gave is "today" instead of using the actual current date. if yy is specified but cc is not, a value for yy between 69 and 99 gives you a cc value of 19. otherwise, a cc value of 20 is used. time travel but make it a flag ๐Ÿ•ฐ๏ธ
  • -w โ€” prints the day of the week name in front of each event. cute AND informative.

so to handle calendars in your national code table, you can specify "LANG=<locale_name>" in the calendar file, as early as possible pls. and to handle national Easter names in the calendars, you can use "Easter=<national_name>" (for Catholic Easter) or "Paskha=<national_name>" (for Orthodox Easter).

there's also a special locale name: utf-8. specifying "LANG=utf-8" means the dates will be read using the C locale, and the descriptions will be encoded in UTF-8. this is usually used for the distributed calendar files. the "CALENDAR" variable can specify the style โ€” only Julian and Gregorian styles are currently supported. use "CALENDAR=" to return to the default (Gregorian).

to enforce special date calculation mode for Cyrillic calendars, you should specify "LANG=<local_name>" and "BODUN=<bodun_prefix>", where <local_name> can be ru_RU.UTF-8, uk_UA.UTF-8 or by_BY.UTF-8.

๐Ÿ’ก note that the locale is reset to the user's default for each new file that is read. this is so that locales from one file don't accidentally carry over into another file. no cross-contamination, we respect boundaries ๐Ÿ’…

other lines should begin with a month and a day. they may be entered in almost any format, either numeric or as character strings. if the proper locale is set, national months and weekdays names can be used.

  • a single asterisk (*) matches every month.
  • a day without a month matches that day of every week.
  • a month without a day matches the first of that month.
  • two numbers default to the month followed by the day.
  • lines with leading tabs default to the last entered date, which lets you do multiple line specifications for a single date.
  • "Easter" (may be followed by a positive or negative integer) is Easter for this year.
  • "Paskha" (may be followed by a positive or negative integer) is Orthodox Easter for this year.
  • weekdays may be followed by "-4" ... "+5" (aliases last, first, second, third, fourth) for moving events like "the last Monday in April".

by convention, dates followed by an asterisk (*) are not fixed, i.e., they change from year to year. it's giving chaotic but in a scheduled way.


day descriptions start after the first <tab> character in the line โ€” and if the line does not contain a <tab> character, it isn't printed out. periodt. if the first character in the line is a <tab> character, it's treated as the continuation of the previous description.

the calendar file is preprocessed by cpp(1), which allows the inclusion of shared files like company holidays or meetings. if the shared file isn't referenced by a full pathname, cpp(1) searches in the current (or home) directory first, and then in the directory /etc/calendar, and finally in /usr/share/calendar. empty lines and lines protected by the C commenting syntax (/* ... */) are ignored. ๐Ÿ™ˆ

some possible calendar entries (a \t sequence denotes a <tab> character):

LANG=C
Easter=Ostern

#include <calendar.usholiday>
#include <calendar.birthday>

6/15\tJune 15 (if ambiguous, will default to month/day).
Jun. 15\tJune 15.
15 June\tJune 15.
Thursday\tEvery Thursday.
June\tEvery June 1st.
15 *\t15th of every month.

May Sun+2\tsecond Sunday in May (Muttertag)
04/SunLast\tlast Sunday in April,
\tsummer time in Europe
Easter\tEaster
Ostern-2\tGood Friday (2 days before Easter)
Paskha\tOrthodox Easter

๐Ÿ’œ FILES ๐Ÿ’œ

  • calendar โ€” File in current directory.
  • ~/.calendar โ€” Directory in the user's home directory (which calendar changes into, if it exists).
  • ~/.calendar/calendar โ€” File to use if no calendar file exists in the current directory.
  • ~/.calendar/nomail โ€” calendar will not send mail if this file exists.
  • calendar.all โ€” International and national calendar files.
  • calendar.birthday โ€” Births and deaths of famous (and not-so-famous) people.
  • calendar.canada โ€” Canadian holidays.
  • calendar.christian โ€” Christian holidays (should be updated yearly by the local system administrator so that roving holidays are set correctly for the current year).
  • calendar.computer โ€” Days of special significance to computer people.
  • calendar.croatian โ€” Croatian calendar.
  • calendar.discord โ€” Discordian calendar (all rites reversed).
  • calendar.fictional โ€” Fantasy and fiction dates (mostly LOTR).
  • calendar.french โ€” French calendar.
  • calendar.german โ€” German calendar.
  • calendar.history โ€” Miscellaneous history.
  • calendar.holiday โ€” Other holidays (including the not-well-known, obscure, and really obscure).
  • calendar.judaic โ€” Jewish holidays (should be updated yearly by the local system administrator so that roving holidays are set correctly for the current year).
  • calendar.music โ€” Musical events, births, and deaths (strongly oriented toward rock 'n' roll).
  • calendar.nz โ€” New Zealand calendar.
  • calendar.openbsd โ€” OpenBSD related events.
  • calendar.pagan โ€” Pagan holidays, celebrations and festivals.
  • calendar.russian โ€” Russian calendar.
  • calendar.space โ€” Cosmic history.
  • calendar.uk โ€” UK calendar.
  • calendar.ushistory โ€” U.S. history.
  • calendar.usholiday โ€” U.S. holidays.
  • calendar.world โ€” World wide calendar.

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

at(1), cal(1), cpp(1), mail(1), cron(8)


๐Ÿ“ STANDARDS ๐Ÿ“

ngl, the calendar program previously selected lines which had the correct date anywhere in the line. this is no longer true: the date is only recognized when it occurs at the beginning of a line. glow-up behavior honestly.


๐Ÿ”„ COMPATIBILITY ๐Ÿ”„

the calendar command will only display lines that use a <tab> character to separate the date and description, or that begin with a <tab>. this is different than in previous releases. evolution ๐Ÿ’…

the Fl t flag argument syntax is from the original FreeBSD calendar program.

the -l and -e flags are Debian-specific enhancements. option -e used to be called -w in Debian, but this option is now used differently by upstream. also, the original calendar program did not accept 0 as an argument to the -A flag.

using utf-8 as a locale name is a Debian-specific enhancement.


๐Ÿ“œ HISTORY ๐Ÿ“œ

A calendar command appeared in Version 7 AT&T UNIX. ancient. iconic. the blueprint. ๐Ÿ‘‘


๐Ÿ’€ BUGS ๐Ÿ’€

calendar doesn't handle all Jewish holidays or moon phases. yeah. it's not perfect bestie, we know. ๐Ÿ˜ญ


Debian ยท January 29, 2019

and that's the whole page babes ๐Ÿซถ this came out of the Debian corner of the world, dated January 29, 2019. go schedule something cute ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from