Yarn

Recent twts in reply to #ny75ulq

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.

After finally finding some time to code, I could fix many things that needed to be redesigned. And a lot of refactoring is needed. Perhaps a few Unit testing would be helpful, since simulating records in the past is always tricky.
#codingSunday

⤋ Read More

@eaplmx@twtxt.net ISO 8601 calendar weeks for the win, indeed! Week 1 contains 4th January, basically the first week where most days are in the new year rather than the old year. Which calendar week definition is used in Mexico?

What was the issue you had?

⤋ Read More

@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

BTW for my personal Weekly planning I use the ISO date instead of 16january2022, b/c is easier to me to calculate time between week 14 and 22 than between random dates.
Also for work we switched to “months” of 4 weeks. I learned that working with Germans and works well!

If it’s interesting for any of you, you can check the current week enabling it in your calendar app or here:
https://gemugami.com/week/

⤋ Read More

Participate

Login to join in on this yarn.