プロジェクト

全般

プロフィール

Vote #77315

完了

Respect user's timezone when comparing / parsing Dates

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
I18n_37
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
37
version_id:
110
issue_org_id:
22320
author_id:
40856
assigned_to_id:
1
comments:
9
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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":https://plan.io/redmine-hosting 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@.


journals

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

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

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,New,16482,Wrong search query for timelog, when timezone not UTC
relates,New,23189,Spent time by filter, offset by one day
relates,Closed,6470,timezone adjust start/due date
duplicates,Closed,20473,Respect the user's timezone when querying issues
duplicates,Closed,19033,Filters that utilize date/time ignore user's UTC offset

Admin Redmine さんが3年以上前に更新

  • カテゴリI18n_37 にセット
  • 対象バージョン3.3.0_110 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0