I'm very curious how a bug like this could even happen. At a glance it doesn't appear to be the classic "ISO week-based year" problem discussed on HN a few times before, but somehow the code thinks Feb 1 2019 is a Wednesday... weeks starting with Sun vs Mon wouldn't account for the off-by-2 error seen here.