Content
View differences
Updated by Christophe Bliard almost 3 years ago
### Steps to reproduce
1. Change your OS clock to set the time to 0:30 with CET/CEST time zone (UTC+1/UTC+2)
2. Create a work package
3. In the work package list, add a filter "Created on" with "today"
### What is the buggy behavior?
* The work package just created is not shown
* It is visible if selecting "1 day ago"
* From a user perspective, it was created today.
* The example here is contrived, but for people located on places with a big difference from UTC, it can make a difference:
* In Japan (UTC+9) or Australia (UTC+8 to UTC+10:30), a work package created at 7 AM will be considered created yesterday
* In US East coast (UTC-7), a work package created at 4 pm will not be visible anymore after 5pm, because in utc it's 12pm and it's already tomorrow
* Note that the behavior sometimes uses the server time zone (when using `Date.today` in `app/models/queries/operators/date_range_clauses.rb`), and sometimes the Rails time zone (when using `Date.current`). Sometimes they are the same, but they could be different.
### What is the expected behavior?
1. The user time zone should be used, the one configured in user's settings
1. That means that two people with different time zones will potentially see a different list of work packages.
2. code can be similar to the `around` action found in `MeetingsController#set_time_zone`
We should discuss which trade-off is best:
1. either display work packages potentially irrelevant from a user point of view (because out of the requested date range) but identical for all users regardless of their configured time zone
2. or display the work packages corresponding to the current user time zone, but potentially different for users withs different configured time zone.
This is true for "Created on" filter, but also for some other filters based on dates (updated on), for other operators (more than, less than, between, in more than, etc), and potentially for other objects having similar filters (projects, users, time entries, costs, etc)
### Screenshots and other files
Work package created on June 7 at 0:30 UTC+2 is visible with the "Created on" "this week" filter
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/57770/content"> op-uc-image_inline">
But not with the "Created on" "today" filter (current time is 2023-06-07 10:12 08:14 UTC+2)
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/57771/content"> op-uc-image_inline">
It can be viewed by using the "Created on" "days ago" "1 days" filter (current time is 2023-06-07 10:05 UTC+2). The issue is especially visible on this screenshot with the "Created on" column displayed: if the filter is "created on 1 day ago", it seems wrong to display a work package with a created on not matching the query. 08:14 UTC+2)
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/57769/content"> op-uc-image_inline">
And two work packages created on the same UTC day can be list as 2 different days depending on the user time zone:
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/57776/content">
### Environment information
_Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs_
**OpenProject installation type**
* [x] Hosted cloud edition
* [ ] Packaged installation
* What distribution?
* [ ] Docker All-in-one container
* [ ] Docker-compose installation
* [ ] Other (please specify)
**OpenProject version**
community community
<figure class="table op-uc-figure_align-center op-uc-figure"><table class="op-uc-table"><tbody><tr class="op-uc-table--row"><td class="op-uc-table--cell"><p class="op-uc-p">eu-community.openproject.eu</p></td><td class="op-uc-table--cell"><p class="op-uc-p">13.0.0.28e723b56e</p></td><td class="op-uc-table--cell"><p class="op-uc-p">Fri, 02 Jun 2023 13:04:47 GMT <a class="op-uc-link" href="https://github.com/opf/saas-openproject/commit/28e723b56e">28e723b56e</a></p></td></tr></tbody></table></figure>
**Browser**
* [ ] Chrome
* [x] Firefox
* [ ] Safari
* [ ] Mobile Safari
* [ ] Other (please specify)
**Language**
English with Europe/Berlin time zone (UTC+2 / CEST)
1. Change your OS clock to set the time to 0:30 with CET/CEST time zone (UTC+1/UTC+2)
2. Create a work package
3. In the work package list, add a filter "Created on" with "today"
### What is the buggy behavior?
* The work package just created is not shown
* It is visible if selecting "1 day ago"
* From a user perspective, it was created today.
* The example here is contrived, but for people located on places with a big difference from UTC, it can make a difference:
* In Japan (UTC+9) or Australia (UTC+8 to UTC+10:30), a work package created at 7 AM will be considered created yesterday
* In US East coast (UTC-7), a work package created at 4 pm will not be visible anymore after 5pm, because in utc it's 12pm and it's already tomorrow
* Note that the behavior sometimes uses the server time zone (when using `Date.today` in `app/models/queries/operators/date_range_clauses.rb`), and sometimes the Rails time zone (when using `Date.current`). Sometimes they are the same, but they could be different.
### What is the expected behavior?
1. The user time zone should be used, the one configured in user's settings
1. That means that two people with different time zones will potentially see a different list of work packages.
2. code can be similar to the `around` action found in `MeetingsController#set_time_zone`
We should discuss which trade-off is best:
1. either display work packages potentially irrelevant from a user point of view (because out of the requested date range) but identical for all users regardless of their configured time zone
2. or display the work packages corresponding to the current user time zone, but potentially different for users withs different configured time zone.
This is true for "Created on" filter, but also for some other filters based on dates (updated on), for other operators (more than, less than, between, in more than, etc), and potentially for other objects having similar filters (projects, users, time entries, costs, etc)
### Screenshots and other files
Work package created on June 7 at 0:30 UTC+2 is visible with the "Created on" "this week" filter
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/57770/content">
But not with the "Created on" "today" filter (current time is 2023-06-07 10:12
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/57771/content">
It can be viewed by using the "Created on" "days ago" "1 days" filter (current time is 2023-06-07 10:05 UTC+2). The issue is especially visible on this screenshot with the "Created on" column displayed: if the filter is "created on 1 day ago", it seems wrong to display a work package with a created on not matching the query.
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/57769/content">
And two work packages created on the same UTC day can be list as 2 different days depending on the user time zone:
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/57776/content">
### Environment information
_Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs_
**OpenProject installation type**
* [x] Hosted cloud edition
* [ ] Packaged installation
* What distribution?
* [ ] Docker All-in-one container
* [ ] Docker-compose installation
* [ ] Other (please specify)
**OpenProject version**
community
<figure class="table op-uc-figure_align-center op-uc-figure"><table class="op-uc-table"><tbody><tr class="op-uc-table--row"><td class="op-uc-table--cell"><p class="op-uc-p">eu-community.openproject.eu</p></td><td class="op-uc-table--cell"><p class="op-uc-p">13.0.0.28e723b56e</p></td><td class="op-uc-table--cell"><p class="op-uc-p">Fri, 02 Jun 2023 13:04:47 GMT <a class="op-uc-link" href="https://github.com/opf/saas-openproject/commit/28e723b56e">28e723b56e</a></p></td></tr></tbody></table></figure>
**Browser**
* [ ] Chrome
* [x] Firefox
* [ ] Safari
* [ ] Mobile Safari
* [ ] Other (please specify)
**Language**
English with Europe/Berlin time zone (UTC+2 / CEST)