Calendar: Difference between revisions
Content deleted Content added
m →{{header|Raku}}: change name of $months-per-col to $months-per-row for accuracy |
|||
Line 4,613:
</lang>
=={{header|Mathematica}}/{{header|Wolfram Language}}==
Calendar is set of routines for handling calendars; It is built into Mathematica.
We're only going to use it for a two functions, namely, '''DayOfWeek''' and '''DaysBetween'''.
<lang Mathematica>
Needs["Calendar`"];
</lang>
Monthly calendar takes a year and a month and returns a simply formatted calendar for that month.
It knows about leap years.
<lang Mathematica>monthlyCalendar[y_, m_] := ▼
▲monthlyCalendar[y_, m_] :=
Module[{
days = {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday},
Line 4,648 ⟶ 4,643:
7],
shortDays],
{months[[m]], SpanFromLeft}]]]</lang>
'''yearlyCalendar''' prints out calendars for each of the 12 months in the year.
<lang
▲ yearlyCalendar[y_] := Grid[Partition[Table[monthlyCalendar[y, k], {k, 12}], 3], Spacings -> {4, 2}];
=={{header|Nim}}==
|