Project

General

Profile

Actions

Patch #22320

closed

Respect user's timezone when comparing / parsing Dates

Added by Jens Krämer about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Category:
I18n
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

This patch replaces all occurrences of Date.today with User.current.today.

Date.today always returns the date according to the server's local time zone, leading to all sorts of edge cases that occur more or less often depending on how large the offset between a user's timezone and the server timezone is. A test case illustrating the problem using Issue#overdue? as an example is included.

The patch was extracted from Planio and also includes the changes proposed earlier by Holger Just in #20473, with the addition of two test cases to cover the date manipulation changes in Query#date_clause.


Files


Related issues

Related to Redmine - Defect #16482: Wrong search query for timelog, when timezone not UTCNew

Actions
Related to Redmine - Defect #23189: Spent time by filter, offset by one dayNew

Actions
Related to Redmine - Feature #6470: timezone adjust start/due dateClosed2010-09-23

Actions
Has duplicate Redmine - Patch #20473: Respect the user's timezone when querying issuesClosed

Actions
Has duplicate Redmine - Defect #19033: Filters that utilize date/time ignore user's UTC offsetClosed

Actions
Actions #1

Updated by Jan from Planio www.plan.io about 8 years ago

  • Target version set to Candidate for next minor release
Actions #2

Updated by Jan from Planio www.plan.io about 8 years ago

  • Has duplicate Patch #20473: Respect the user's timezone when querying issues added
Actions #3

Updated by Jan from Planio www.plan.io about 8 years ago

  • Has duplicate Defect #19033: Filters that utilize date/time ignore user's UTC offset added
Actions #4

Updated by Jens Krämer about 8 years ago

TimeZone actually has a today method, this patch changes User#today to use it.

Actions #5

Updated by Jan from Planio www.plan.io about 8 years ago

  • Related to Defect #16482: Wrong search query for timelog, when timezone not UTC added
Actions #6

Updated by Toshi MARUYAMA about 8 years ago

  • Target version changed from Candidate for next minor release to 3.3.0
Actions #7

Updated by Jean-Philippe Lang about 8 years ago

  • Category set to I18n
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Committed, thanks.

Actions #8

Updated by Jean-Philippe Lang almost 8 years ago

  • Related to Defect #23189: Spent time by filter, offset by one day added
Actions #9

Updated by Go MAEDA over 5 years ago

Actions

Also available in: Atom PDF