This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A Monday preceding the first post on this blog. Used for calculating week numbers | |
# (Weeks start on Mondays) | |
FIRST_MONDAY = date(2000, 2, 14) | |
# Calculate week_number and streak_weeks for every post, in order. For calculating today's | |
# streak, we only need to know about the most recent post, but there's a certain amount of | |
# looking at other posts to figure that out. | |
# Note: this code looks at *all* posts because I want to calculate all streaks. For just | |
# today's streak, a quicker algorithm would run in reverse chronological order and stop at | |
# the first break. |