4 ms·
This is pretty clever and I admire the author for coming up with an elegant way to show the mapping of week days to dates. I'd be particularly interested to see
by intrepidhero 7y ago
This is pretty clever and I admire the author for coming up with an elegant way to show the mapping of week days to dates. I'd be particularly interested to see the algorithm behind it. Date computations are very tricky.
A few years ago I made script to generate a one page calendar because the ones they hand out at work are particularly ugly. In addition to showing the date<->weekday mapping I also wanted it to show holidays and pay periods. This is one of the (few) things stuck on my wall.
https://intrepidhero.gitlab.io/mkcal/cal2020.html https://intrepidhero.gitlab.io/mkcal/cal2020.html
https://gitlab.com/intrepidhero/mkcal https://gitlab.com/intrepidhero/mkcal
- kohtatsu 7y agoGenerate grid (it's static); Find first weekday of month using your favourite algorithm; Print month's name above the column that begins with that weekday.
- intrepidhero 7y agofavourite algorithm is left as an exercise to the reader. ;-)
- zamadatix 7y agoFavorite algorithm can be as simple as "look at the first day of each month on a normal calendar".
- IshKebab 7y agoDate computations like this are not at all tricky.