hlfan left a comment (openstreetmap/openstreetmap-website#6725)
Trying a less compressed explanation:
Rails is padding the month label range here:
https://github.com/openstreetmap/openstreetmap-website/blob/5b3210c5f637596ed65e75c2173990055b11fe5c/app/helpers/heatmap_helper.rb#L12
This is to have the "outgoing" month labeled even if the date range doesn't
include it.
To give the months an unique identifier also across years, every January the
index is additionally incremented by 12.
However, that means that even if
1. Rails correctly starts the padded month label indices with 12 in December and
2. JS correctly deuces the month of the first full week to be January with
index 1
then JS incorrectly assumed the labels to start at 1 or less.
While this logic is needed to drop labels if the previous month barely reaches
into the new new month's first week, it shouldn't drop a year worth of labels
due to desynced indices.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6725#issuecomment-3774279245
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6725/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev