top | item 36007128

Show HN: Weekle – a web app to learn how to calculate the day of the week

122 points| benjoffe | 2 years ago |benjoffe.com | reply

Mentally calculating the day-of-the-week for any date in history sounds like an impossible task for a normal person, but the algorithm is actually pretty simple to learn.

Although there are tutorials for this elsewhere online, and little quizzes available, there didn't seem to be anything well optimised with multiple practice modes etc.

I originally created a basic version of this just for myself, but a small group of friends and family found it interesting and gave suggestions such as the daily game.

Multi-lingual support is a bit rudimentary at the moment, it will only translate the month names and weekday names, not other text. If any translation mistakes are identified please let me know.

Other feedback is welcome too.

32 comments

order
[+] jen729w|2 years ago|reply
Dividing by 7 is also a cool trick and it’s way easier than this.

1/7th is 0.142857 recurring. All you need to remember is one-four-two-eight-five-seven. Say it over and over. It’s my favourite number.

The magic: to get 2/7, 3/7, any/7, just move the decimal point:

- 2/7: 0.285714285714…

- 3/7: 0.428571428571…

- 4/7: 0.571428571428… (I’m typing these out but ‘from memory’ but not really: only by knowing 1-4-2-8-5-7)

- 5/7 & 6/7: left as an exercise for the reader.

So then the trick is to play a bit of mental magic. Pretend like this is really hard and that every decimal point is stretching your mental capacity to its very edge.

31/7? That’s 4, with 3/7 left over. Say it out loud as you gaze in to the middle distance and do this difficult, difficult calculation in your head: “four point four two eight five seven … one four … two eight five … seven one four …” and so on.

A fun trick which is very occasionally practically useful.

[+] hackernewds|2 years ago|reply
that's really cool. but how does it help determine the day of week?
[+] replwoacause|2 years ago|reply
I don’t follow. How does this calculate the day of week?
[+] account-5|2 years ago|reply
Not one part of this makes any sense to me.
[+] midasuni|2 years ago|reply
First question was “08/10/2023”

The majority of the world uses little endian, so the 8th day of the 10th month of the 2023rd year. 8th October is Sunday, as I know that because it’s the same day as 9th of May.

However experiments E has told me that much of the internet uses the minority American view of “middle endian”

Probably worth making it clear.

[+] opan|2 years ago|reply
Year-Month-Day (YYYY-MM-DD) is the international standard and ought to be used in any new projects.
[+] benjoffe|2 years ago|reply
Thanks, there is some attempt in the code to auto select US/Canada date format if the user's timezone is in the USA or Canada, but I didn't actually test it to see if it is activated correctly. Any US user's able to chime in if it does?

Even if it works, I'll probably take your suggestion add a tip below the date to clarify the date format for the user's first session.

[+] naniwaduni|2 years ago|reply
Big-endian numerals in little-endian component order is still ixUn-endian! YMD or little-endian numerals, then we can talk :p
[+] hluska|2 years ago|reply
My seven year old thinks I have superpowers now. Needless to say, I’m a big fan - it’s pretty amazing to go from learning to applying as quickly as I did. Great job!
[+] keerthiko|2 years ago|reply
Love it, why can I not choose YYYY/MM/DD as my date format though (tbh this should be default with manual selection to anything else!)
[+] benjoffe|2 years ago|reply
Thanks. I like your suggestion and I'll add a YYYY-MM-DD only option.
[+] scotteh|2 years ago|reply
This looks easier to memorise than another method: https://en.wikipedia.org/wiki/Doomsday_rule

Nice work on the site!

[+] robobro|2 years ago|reply
How is it easier? I can do Doomsday in about 5 seconds for any year AD 1800 - 2200
[+] entropy47|2 years ago|reply
Can you add more detail on the year table at the very bottom / how you're meant to use it? I can memorise it but I'm not sure how you're meant to use it after that.
[+] benjoffe|2 years ago|reply
Thanks, that's a good point that it does not clearly explain the use of that table. I will update the page soon to explain that the table cell represents the last 2 digits of a year, and the left column is the result of the year calculation for that year. The table has only 28 years in it since any year 28 or higher can be simplified by subtracting 28, 56 or 84.

I recommend only attempting to memorise the table after you are already able to calculate the year number using the normal algorithm.

[+] connordoner|2 years ago|reply
I love the bit that sticks out on desktop with the QR code. Stellar work, Ben!
[+] Retr0id|2 years ago|reply
That's funny, I actually came here to complain about that. I find it visually distracting and there was no obvious way to dismiss it, so I had to use a content blocker.
[+] AdieuToLogic|2 years ago|reply
> Mentally calculating the day-of-the-week for any date in history sounds like an impossible task for a normal person ...

  $ cal <month> <year>
And look :-)