Project

General

Profile

Actions

Patch #20473

closed

Respect the user's timezone when querying issues

Added by Holger Just over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

When querying issues and using date-based filters like "today" or "3 days ago" or "last month", Redmine uses the current date according to the server's local time as a reference. This might however not be the day in the user's timezone if they use a different one as the server. These queries can then show unexpected issues that do not match the filter according to the user's timezone.

Furthermore, even if the date is correct, the exact cut-off time still needs to be done in the user's timezone. Suppose the server is set to GMT and the user has configured Europe/Berlin (GMT+2:00 right now) as their time zone. When querying for all issues updated yesterday, the result should include all issues updated between 2015-08-03 02:00:00 GMT and 2015-08-04 01:59:59 GMT. Right now, it would however only include issues updated between 2015-08-03 00:00:00 GMT and 2015-08-03 23:59:59 GMT.

The attached patch against the current trunk fixes both of these issues by applying the following changes to the query model:

  • It calculates the cut-of time based on the current user timezone instead of assuming midnight at server-local time
  • it uses User.current.today instead of Date.today to get the correct reference day in the user's timezone

The patch was extracted from Planio.


Files


Related issues

Related to Redmine - Defect #19033: Filters that utilize date/time ignore user's UTC offsetClosed

Actions
Is duplicate of Redmine - Patch #22320: Respect user's timezone when comparing / parsing DatesClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF