RSS Sort broken
On the main RSS the entires are limited to 10, to select
the top 10 it is first sorted by the pub_date key
items.sort_by_key(|item| item.pub_date().map(|s| s.to_string()));.
However this date is formated with rfc 2822 so it’s starting
with the day of the week “mon/tue/…” resulting in the sort
making no sense, when it should be sorting by latest first.
Argh.
Good catch. Thank you. I always use ISO8601 and I blithely assumed that was the case where, when I wrote the sorting. And I failed to add a unit test to verify the sorting, too.
And of course I now see I wrote the code to generate an RFC 2822 time stamp. So much fail.
Made a patch to fix this:
7e2ccf45c9c7c93954ee9874584a5c9226e6b7feCouldn’t figure out an easy way to set up a test for this, though.