Calendar: Difference between revisions

Content added Content deleted
m (→‎{{header|Sidef}}: Fix link: Perl 6 --> Raku)
(→‎{{header|Visual Basic .NET}}: adding new section)
Line 8,287: Line 8,287:
28 29 30 31
28 29 30 31
</pre>



{{header|WYLBUR}}

Unlike IBM 3278 terminals,
WYLBUR was "of the time" of 1969. And rather than being a simulation of its display in 20-column mode, the "output" below is an adaptation of the actual display (as simple to create & use in any other text editor not using proportional spacing) for html. This entry is intended to show that WYLBUR could display 1969's calendar in a much smaller area than traditional alternatives (even without ORVYL). It also accomodates the display of Julian and even Old Style Calendars, if one knows how to calculate the day for any Key Date in a given calendar year (using a less involved formula than for Gregorian dates).

A month appears as numbers (Roman numerals for leap years) below a column of dates which are defined as "Key Dates" for the corresponding months. A Key Day is the day of the week on which Key Dates occur in a calendar year. Step A describes how to find the Key Day, which is used in Step B to display a calendar just by sliding the columns of dates in the lower output window. In WYLBUR, one slides the row of weekdays instead by inserting or deleting spaces to the left of "Su" (and vastly easier to align than here using html).

A. Calculate the Key Day: for a given date in the Gregorian calendar, calculate the day on which its Key Dates occur using ([YT32 div 16]+ YTMB div 4 + Year) mod 7. (YTMB = the Year Two Months Before the given date. For Julian & Old Style dates, omit the [~] term where the last 2 digits of YTMB are replaced by 32.) The remainder of the division by 7 gives the Key Day as follows: 0=Su -> 6=Sa

B. Display the calendar for November: slide the row of days so that the Key Day rests over 28 thereby showing the calendar for November. One has as well the calendar for the prior March corresponding to the type of Calendar as listed in the Month Key.
{{output}}
<pre>
Every Year Calendar
--------------------
Su Mo Tu We Th Fr Sa
</pre>
<pre style="width:25ex;height:35x;overflow:scroll">

.....................1..2..3..4..5..6
.1..2..3..4..5..6..7..8..9.10.11.12.13
.8..9.10.11.12.13.14.15.16.17.18.19.20
15.16.17.18.19.20.21.22.23.24.25.26.27
22.23.24.25.26.27.28.29.30.31
29.30.31
..........i.09.................i.09...
ii.05.00.04.12.06.03.ii.05.00.04.12.06
08.13.10.07.xv.14.11.08.13.10.07.xv.14
</pre>
Month Key
over the following
span of months for
the relevant Calendar:
<pre>
00 non-leap JAN on Julian or Gregorian
.i a leap JAN on Julian or Gregorian
ii a leap FEB on Julian or Gregorian
03 non-leap FEB on Julian or Gregorian
03 MAR on Julian or Gregorian
--
03 25-31 MAR on Old Style Calendar
04 to 12: April-December on all 3
13 jan on Old Style Calendar
14 feb on Old Style Calendar
14 mar 01-24 in an Old Style non-leap year
xv mar 01-24 in an Old Style leap year
</pre>
</pre>