Wednesday, June 23, 2021

The calendar broke (again). I fixed it (again).

Such is the life of anyone in IT - you fix something, it works for a while, then it inevitably breaks again.

This time it's different, and I don't plan on it breaking again, unless there are massive changes across the board to the back end.

This update is minor and I've retrofitted all previous downloadable files with the fix.

In short, I didn't read the man page completely and thus the %b option for date printed the abbreviated month. Well, May is only three letters long, so its full name is the same as its abbreviated name. Since Jun does not equal June, the regex match for the month fails. If we change the date command's formatting argument to %B, then we get the full month and the regex match completes.

I've updated the patch file (if you're still using v1) and v2 of the script.

Link: Script v2

Link: Patch file (if you're still on v1 and want to upgrade to v2) 

Have fun!