0

Here is a Maple calendar for 2022 as an example. I am pretty sure there is a lot of nice Mathematica visualizations of deep math results which may be used for such a calendar for 2023. I am not strong in that field and because of this reason I ask it at this forum.

enter image description here

Let us make better.

user64494
  • 26,149
  • 4
  • 27
  • 56
  • I suggest you have a read about what is on-topic here https://mathematica.stackexchange.com/help/on-topic and particularly what is off-topic here : https://mathematica.stackexchange.com/help/dont-ask. I'm afraid you are asking an opinion/subjective open ended question, and not a programming question. Consequently, I'm voting to close this question. You can [edit] your question to prevent or revert closure. – rhermans Nov 17 '22 at 16:36
  • 1
    @rhermans: Thank you for your personal opinion. I disagree with you. I think this is a good idea. Few years ago I was given as a gift such a calendar from the AMS. – user64494 Nov 17 '22 at 16:47
  • 1
    @rhermans: How about that question? There are many questions of such type in this forum. – user64494 Nov 17 '22 at 16:51
  • https://rosettacode.org/wiki/Calendar#Mathematica/Wolfram_Language – lericr Nov 17 '22 at 16:58
  • 2
    Right. We each have votes to use according to our judgment. It takes more than one vote to close. We don't need to argue with people about their votes. – lericr Nov 17 '22 at 16:59
  • @lericr: Sorry, but your example is not better than quoted by me. – user64494 Nov 17 '22 at 17:03
  • omg. I think you're taking me a bit too seriously. – lericr Nov 17 '22 at 17:03
  • 1
    I guess the meta point here is that you can create structures however you want, even a text-only calendar. Your question is just an open-ended challenge-ish type of question with no specific purpose or coding question. You might as well ask whether Mathematica can be used to show a map of the galaxy or a representation of a clade for studying evolution or whtever. – lericr Nov 17 '22 at 17:07
  • 1
    I agree that this is off-topic on the main site, but it's also fun to do and good for community building on this site. I suggest migrating to meta, and discussing it in chat. I'm sure many people would enjoy contributing. @rhermans It could be a way to encourage more participation in chat / meta. – Szabolcs Dec 01 '22 at 08:56

1 Answers1

3

I guess a proper presentation would require a bit more time. Here I have a fake calendar with essential structure. 35 is the total number of slots for dates, 31 is the number of days in this fake Month, 5 is the offset for the first day (Sunday being 0). The dates fold up as shown on to the first row as a bonus feature.

Prepend[
  Prepend[
   Partition[
    RotateRight[
     PadRight[Range[31], 35, ""], 5]
    , 7, 7],
   {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}]
  , {"Month", SpanFromLeft}] // Grid

enter image description here


EDIT-1

Clear[mCal]
mCal[d_DateObject, lang_String : "English"] := 
 Module[{day, month, year, firstDay, monthNames, dayNames, dayRules, 
   daysInMonth, calM, todayPos},

day = If[MissingQ[d["Day"]], "", d["Day"]]; month = d["Month"]; year = If[MissingQ[d["Year"]], Today["Year"], d["Year"]];

daysInMonth = {31, If[LeapYearQ[{year}], 29, 28], 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; monthNames = { "January", "February", "March", "April" , "May", "June", "July", "August" , "September", "October", "November", "December"}; dayNames = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; dayRules = {Monday -> 1, Tuesday -> 2, Wednesday -> 3, Thursday -> 4, Friday -> 5, Saturday -> 6, Sunday -> 0};

firstDay = (DateObject[{year, month, 1}]["DayName"] /. dayRules);

calM = Partition[ RotateRight[ PadRight[Range[daysInMonth[[month]]], 35, ""], firstDay] , 7, 7];

todayPos = If[day == "", {0, 0}, First@Position[calM, day] + {2, 0}];

Prepend[ Prepend[calM, Style[#, 14] & /@ dayNames] , {Style[monthNames[[month]] <> " " <> ToString@year, 20 , FontFamily -> "Old English Text MT" ], SpanFromLeft}] // Grid[# , Spacings -> {0.4, 0.8} (*,Frame[Rule]All*) , Background -> {None, None , {todayPos -> GrayLevel[0.85]} } , Alignment -> {Center, Center} , Dividers -> {{False}, {False, True, True, {False}}} , ItemSize -> {2, {2.5, 2, {1.2}}} , ItemStyle -> {Automatic, Automatic, { {{2, -1}, {1, 1}} -> Red , {{2, -1}, {6, 6}} -> Darker@Darker@Green , {{2, -1}, {7, 7}} -> Blue} } ] & ]


Usage:

If a date is provided it is highlighted. English is the default (only) language available.

d1 = DateObject[{2022, 11}];
d2 = DateObject[Today]
mCal /@ {d1, d2}

Calendar 2023

cal2023 = Grid[
   Partition[#, 3] &@
    (Framed[#, FrameMargins -> {{2, 4}, {3, 3}}] & /@
      mCal /@ (DateObject[{2023, #}] & /@ Range[12])
     ), Spacings -> {0.2, 0.2}
   ];
Export["C:/cal2023.pdf", cal2023]
Syed
  • 52,495
  • 4
  • 30
  • 85
  • 1
    +1. Thank you for your constructive reply, My question need not be answered in short time: we have at least 44 days to this end. – user64494 Nov 17 '22 at 17:43
  • This is a usual calendar done with Mathematica. The beauty and content of calendars consist in commented illustrations as in the linked Maple calendar. Sorry, you answered the suggestion of @lericr, not my question. I will be waiting for a rich-in-content calendars. – user64494 Nov 17 '22 at 19:12
  • Also the previous and next months are not displayed so this is not practical. BTW, did you look in the Maple one? Or only in https://rosettacode.org/wiki/Calendar#Mathematica/Wolfram_Language? – user64494 Nov 17 '22 at 19:28
  • Now that you mention it, I downloaded it. It is nice and I wouldn't know how to generate similar pictures to put in there. If the question is still open I might add next and previous months. For that, I will have to make a miniaturized version since font sizes are hardcoded. – Syed Nov 17 '22 at 19:35
  • The pictures in the Maple one are commented visualizations of math results done with Maple. The question is still open as yet. Such calendars are business cards of organizations. – user64494 Nov 17 '22 at 20:07