[openstreetmap/openstreetmap-website] Fix month label index desync causing missing labels (PR #6725)
Marwin Hochfelsner
notifications at github.com
Tue Jan 20 18:12:22 UTC 2026
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/c3774279245 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260120/818ef4ef/attachment.htm>
More information about the rails-dev
mailing list