Log In  


Cart #perpetual_calendar-6 | 2024-10-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

A calendar for when you need to know what day of the week any date is on but don't want to leave Pico-8 for some reason

⬆️/⬇️ change year
⬅️/➡️ change month
❎/🅾️ change day
❎+🅾️ toggle day highlight

Allows years between -32767 and 32767 because why not?

Disclaimer: This is NOT a historically accurate calendar. This is a Proleptic Gregorian Calendar, a calendar which gives Gregorian dates to all days, including those before it was introduced on October 15th, 1582. Credit to @RealShadowCaster for pointing this out to me

3


Fun history fact, because of a slight imprecision that was accumulating as centuries went by, the calendar was 10 days off in 1582 compared to the sun, and this was fixed by skipping 10 days and changing the leap years rules so it would stay synchronized in the future.
So your calendar is correct starting Friday the 15th of October 1582 (Gregorian), but the day before that is Thursday 4th of October (Julian)

Any simple and sensible assumption about time is false. In the workplace, always use a time library so you can shift the blame to it when things eventually go wrong. (leap seconds nightmare, anyone ?)


@RealShadowCaster Because I'm having a hard time finding exact answers to my questions on Google, could you help me out a second?

If we skipped from the 4th to the 15th, and the 15th was a Friday, would the 4th have been a Thursday or was it a Tuesday and we skipped to Friday as well?

Also, if before that point was the Julian calendar, does that mean I should count all multiples of 4 as leap years instead of excluding multiples of 100?


@0xFFFF967F Beware, you are standing at the edge of a bottomless rabbit hole.
Calendar history is a huge mess, and adoption of the gregorian calendar didn't occur at the same time around the globe, so the answer to what day of the week was <date> can depend on where you are standing and when, when asking the question... In fact, julian calendar is still in use today in certain contexts, so two neighbors can celebrate Xmas on the Dec 25 Gregorian and Dec 25 Julian respectively... Some 13 days apart currently, I think.
Julian calendar is 1 leap year every 4 years, no exception. I don't remember if the leap years were multiple of 4 or not. If you go before the start of the julian calendar, things are even crazier ; you get an extra month from time to time to compensate the shifts, but instead of being used properly, it was used politically : oh, I have a huge debt to pay : too bad, the day of payment doesn't exist any more. You're in power and I don't like it, I'll ask my friends to reduce your mandate by skipping the extra month this year... Total insanity. Julius Ceasar had political interest in setting up a better calendar.

To answer your question, there was no skip in the sequence of 7 days of the week.
We went from Thursday 4th October 1582 (Julian) to Friday 5th October 1582 (Julian) that is also Friday 15th October 1582 (Gregorian).
For your perpetual calendar that shows dates in Gregorian, there's technically no date before 15th October 1582 in that system.
You can do the computations and get the Gregorian day of the week of the previous dates, but they would not be aligned (unless by chance of the shifts) with the dates in use at the time.


@RealShadowCaster That's a lot...

On second thought, I'm okay with it being inaccurate to the past. Like a "what they would've been" kind of calendar, if there's a name for that. That works for me


I like the clear interface you gave it. One can use you program to know "what kind of child am I?" since you calendar will give you the days of the week.

https://en.wikipedia.org/wiki/Monday%27s_Child

I found out I'm "Friday's child is loving and giving,"


@MadeInNL

Am I still loving and giving if I was born on Friday the 13th?


Cool calendar, @0xFFFF967F! I’m a Wednesday.
@0xFFFF967F Sure.

It’s truly awesome that Pico-8 lets folks make working, accurate clocks—and now calendars, too!


Oopsies...

I sure hope nobody realizes the BC years counts leap years incorrectly...

And now it's fixed


I just learned something super useful (That I'm sure plenty of more competent Pico-8-ers already knew)

Apparently you can use tostr(num, 2) to treat a 16.16 number like a 32 bit signed integer, ignoring the decimal basically, and conversely tonum(str, 2) turns a 32 bit number string into the corresponding 16.16 number. Which is great for things like scores with no decimals, or the year for this calendar

This small bit of new information will be extremely helpful going forward


1

@0xFFFF967F , just remember when to shift your data :
score+=100>>16
for example.
You also have to be very careful what to shift and what not to shift when doing multiplications or math function calls.
Having your big integer as two base 10 sub integers is often simpler do deal with.
Or if you are only doing additions, subtractions and multiplication by small numbers, dealing with directly printable strings is also an option for big integer handling.



[Please log in to post a comment]