Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Weekle – a web app to learn how to calculate the day of the week (benjoffe.com)
122 points by benjoffe on May 19, 2023 | hide | past | favorite | 32 comments
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.



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.


that's really cool. but how does it help determine the day of week?


I don’t follow. How does this calculate the day of week?


Not one part of this makes any sense to me.


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.


Year-Month-Day (YYYY-MM-DD) is the international standard and ought to be used in any new projects.


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.


What do you consider the Canadian format? Most people I know prefer YYYY-MM-DD as it's non ambiguous. Anytime you see XX-XX-YYYY (or XX-XX-XX) it could just as easily be be little endian or weird American.


The intention is to present dates the way they often are found in that country (not just the "gold standard"). From my understanding Canadians often encounter dates in all three formats you noted (although often using named months to avoid ambiguity).

All three date formats are used in Weekle when set to Canadian mode, and fully numeric d/m/y or m/d/y dates are only used if the date is >12 to avoid ambiguity.


It did not default for me.

Im in the US, Eastern TZ. Defaulted to English international.

Cool web app btw. I like the whole idea. Just a neat little self contained lesson.


Until you have time to test your localizations, you’re better off just using simple common format.


The initial popup dialogue shows the default locale setting with a "change" button right next to it, and it can be changed at any time on the settings tab.


Big-endian numerals in little-endian component order is still ixUn-endian! YMD or little-endian numerals, then we can talk :p


I've found the Month's First Sunday method[1] (a mild simplification of the Doomsday Algorithm including the odd-plus-eleven innovation) easiest, fastest, and most practical. I'm not insisting on it, just great for me, and I wish it were better known.

[1]: https://firstsundaydoomsday.blogspot.com/2011/01/learn-by-ex...


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!


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!)


Thanks. I like your suggestion and I'll add a YYYY-MM-DD only option.


This looks easier to memorise than another method: https://en.wikipedia.org/wiki/Doomsday_rule

Nice work on the site!


Some years ago I tried to simplify the Doomsday algorithm here: https://gcanyon.wordpress.com/2013/04/09/a-better-way-to-cal...

I don't think that's simpler than the algorithm at weekle, but in case anyone is curious.


How is it easier? I can do Doomsday in about 5 seconds for any year AD 1800 - 2200


I don't think I'll spend the time to memorize the part for the anchor days, but the observation that March 0, 4/4, 6/6, 8/8, 10/10, 12/12 all land on the same day will definitely come in handy.


There's other mnemonics too, "I work 9-5 at the 7/11" and the observation that Jan 3 (normal) and Jan 4 (leap) can be remembered as, "3 times out of 4, it's January 3rd; the 4th, it's Jan 4th"

Silly mnemonics but it's something. The design about even number days all landing on March 0 / last day of Feb is a good and simple one. I don't know what Weekle is innovating -- instead of using an established system of mnemonics and calculations, he just presents his own table with no comments. Maybe his inspiration was to say, "hey guys, I made my own date calculation system" to impress people who don't know about Doomsday?


As I noted in this HN post, I did not invent this system (there are other tutorials online). I'll update the web app itself to state this clearly.

The goal of the web app is more about the practice modes and daily game, people are free to use Doomsday for these if they like.


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.


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.


What do you get for Sep 3 1752?


> What do you get for Sep 3 1752?

An adjustment for clock drift[0]?

0 - https://www.historic-uk.com/HistoryUK/HistoryofBritain/Give-...


I love the bit that sticks out on desktop with the QR code. Stellar work, Ben!


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.


Thanks, I'll add a dismiss button to that popout soon.


> 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 :-)


This was done ages ago.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: