Skip to content

Fix date comparison with episodes from previous year

Fixes #165 (closed).

As explained in the issue above, Podcasts was not classifying episodes correctly if their date was on the previous year. That meant that an episode published on December 31st would be in the 'Older' category on January 1st (instead of being in 'Yesterday').

This MR refactors the date comparison logic so it doesn't rely on dates being in the same year (except for 'This Month').

Notice this PR assumes the week starts on Monday. I would be happy to make it dependend on locale in this MR or in a follow-up if somebody is willing to mentor. I saw there is similar code in gnome-calendar that we might use as a reference, but I'm not used into calling C code from Rust so I might need some help with that.

Merge request reports