calendaryr.ijs

Script: ~adons/finance/finexec/datetime/calendaryr.ijs
Contributor: William Szuch
Updated: 2022 6 26
Depend: nil
Definitions: exported to locale base
Status: done
Script source: calendaryr.ijs

This script defines the calendar year tool as a tacit.
This is an example of building a long tacit from an explicit definition.
Taken from the explicit definition of calendar in dates.ijs (stdlib).
Dealing with a large tacit.

Review using dissect - get error but the tacit works

Definitions

C calendaryr

calendaryr (verb)

Form: tacit
Depend: nil
Based on calendar in dates.ijs (stblib)
Formatted calendar for year and months
Returns calendar for year, as a list of months
Modified to includer year in format.

Syntax

([X])calendaryr(Y,[M])
[X] = optional left argument is the start day of the week
0 = Sunday (default)
1 = Monday
2 = Tuesday etc
Y = year as yyyy
[M] = optional months in the year
      If no months are given, it defaults to all months.

Example

   calendaryr(2014 3 4)
┌─────────────────────┬─────────────────────┐
│     Mar2014         │     Apr2014         │
│ Su Mo Tu We Th Fr Sa│ Su Mo Tu We Th Fr Sa│
│                    1│        1  2  3  4  5│
│  2  3  4  5  6  7  8│  6  7  8  9 10 11 12│
│  9 10 11 12 13 14 15│ 13 14 15 16 17 18 19│
│ 16 17 18 19 20 21 22│ 20 21 22 23 24 25 26│
│ 23 24 25 26 27 28 29│ 27 28 29 30         │
│ 30 31               │                     │
└─────────────────────┴─────────────────────┘
   (2)calendaryr(2014 3 4)
┌─────────────────────┬─────────────────────┐
│     Mar2014         │     Apr2014         │
│ Tu We Th Fr Sa Su Mo│ Tu We Th Fr Sa Su Mo│
│              1  2  3│  1  2  3  4  5  6  7│
│  4  5  6  7  8  9 10│  8  9 10 11 12 13 14│
│ 11 12 13 14 15 16 17│ 15 16 17 18 19 20 21│
│ 18 19 20 21 22 23 24│ 22 23 24 25 26 27 28│
│ 25 26 27 28 29 30 31│ 29 30               │
│                     │                     │
└─────────────────────┴─────────────────────┘