[openstreetmap/openstreetmap-website] Fix month label index desync causing missing labels (PR #6725)
Pablo Brasero
notifications at github.com
Tue Jan 20 13:21:04 UTC 2026
@pablobm commented on this pull request.
I can't wrap my head around this one today 😓 At least I can reproduce the bug and the fix locally: edit the map, then go and check out your heatmap, whether the months render correctly or not.
> @@ -24,7 +25,7 @@ $(document).on("turbo:frame-load", function () {
weekColumn++;
const currentMonth = getMonthOfThisWeek(date);
if (previousMonth === null) {
- previousMonth = currentMonth;
+ previousMonth = currentMonth + (Math.round((monthLabelStartIndex - currentMonth) / 12) * 12);
heatmap.find(`[data-month]:has( ~ [data-month="${previousMonth}"])`).remove();
Incidentally: what does this line do?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6725#pullrequestreview-3682138753
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6725/review/3682138753 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260120/a994983a/attachment.htm>
More information about the rails-dev
mailing list