tomhughes left a comment (openstreetmap/openstreetmap-website#6725)
As I suspected, changing the server code to this:
```ruby
# Get unique months with repeating months and count into the next year with
numbers over 12
month_offset = 0
months = ((from - 2.weeks).to_date..(to + 1.week).to_date)
.map(&:month)
.chunk_while { |before, after| before == after }
.map(&:first)
months = months.take(1) + months.drop(1).map do |month|
month_offset += 12 if month == 1
month + month_offset
end
```
which only adds the extra offset when we see January after another month fixes
the problem.
That code's not very nice though and so far I haven't come up with a cleaner
way to do it...
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6725#issuecomment-3774385563
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