[openstreetmap/openstreetmap-website] Set block ends_at to exactly created_at + duration (PR #4439)

Anton Khorev notifications at github.com
Wed Dec 27 03:56:03 UTC 2023


If you block a user for two weeks, you'll see this:

![image](https://github.com/openstreetmap/openstreetmap-website/assets/4158490/3a756071-782c-44f3-8060-875b7ce56574)

> Duration: 1 week

The block end date is computed before `created_at` and its duration ends up being slightly shorter. Everything is rounded down and you get an incorrect value.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4439

-- Commit Summary --

  * Set block ends_at to exactly created_at + duration

-- File Changes --

    M app/controllers/user_blocks_controller.rb (4)
    M test/controllers/user_blocks_controller_test.rb (15)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4439.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4439.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4439
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4439 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231226/8b2e3011/attachment.htm>


More information about the rails-dev mailing list