In-reply-to » Switching from 2022 to 2023 broke a few things on the weekly processing for FitBot (ISO weeks FTW). Yes, I had a few months to prepare for it, but you know... The end of the year suddenly came.

@lyse@lyse.isobeef.org First day of the week are Sundays, so the first ‘calendar’ week started on January 1st, 2023. That’s problematic for using ISO weeks, but it works for this project. Start of the week is at Sunday-Monday midnight which is about Sun 6pm here. You register your exercise from Sun to Sun.

For this project on Python I used that isocalendar module from datetime lib.

The bad implementation was on using something like

next_week = current_week + 1

which was not valid when the year changed, worked for all 2022 except the last week, ha! This year the weekly summary just stopped working.

And also I had to check when that happens. Some years have 52 weeks and others 53.

⤋ Read More