Vote #79991
完了Show the number of days left until the due date in reminders
0%
説明
It is useful if we can know the due date of each issue in reminder. I think that adding information "Due in X days" or "X days late" for each issue is nice.
[Before]
* eCookbook - Bug #1: Cannot print recipes * OnlineStore - Bug #4: Issue on project 2 * eCookbook - Feature request #2: Add ingredients categories
[After]
* eCookbook - Bug #1: Cannot print recipes (Due in 3 days) * OnlineStore - Bug #4: Issue on project 2 (Due in 1 days) * eCookbook - Feature request #2: Add ingredients categories (3 days late)
journals
I noticed a few weeks ago that reminders from Planio already has the information. It is really useful.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
+1
I think it is useful because I can understand the number of days until the due date.
I attached a patch.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
I applied this patch to my production environment and found that the information "Due in X days" / "X days late" is useful. It made me realize that there were too many overdue issues!
I am setting the target version to 4.1.0.
--------------------------------------------------------------------------------
Committed the patch. Thanks.
--------------------------------------------------------------------------------
The tests fail depending on the timezone.
I think the error occurs when the date of the current timezone is different from the date in UTC. For example, I observed the following error on *20 May* 2019 08:15:00 +0900 (*19 May* 2019 23:15:00 UTC)
<pre>
F
Failure:
MailerTest#test_reminders_should_sort_issues_by_due_date [/Users/maeda/redmines/trunk/test/unit/mailer_test.rb:749]:
<(?-mix:foo \(1 day late\))> expected but was
<eCookbook - Bug #219: foo (2 days late)>..
Expected 0 to be >= 1.
bin/rails test test/unit/mailer_test.rb:738
</pre>
--------------------------------------------------------------------------------
Go MAEDA wrote:
> The tests fail depending on the timezone.
>
> I think the error occurs when the date of the current timezone is different from the date in UTC. For example, I observed the following error on *20 May* 2019 08:15:00 +0900 (*19 May* 2019 23:15:00 UTC)
>
> [...]
Sorry, I fixed to the UTC Date at 0:00 using @travel_to Date.today.to_time(:utc)@ .
This fix eliminates the dependency on time zones.
--------------------------------------------------------------------------------
Yuichi HARADA wrote:
> Sorry, I fixed to the UTC Date at 0:00 using @travel_to Date.today.to_time(:utc)@ .
> This fix eliminates the dependency on time zones.
Unfortunately, tests still fail.
<pre>
$ date
Tue May 21 00:22:38 JST 2019
$ bin/rails test test/unit/mailer_test.rb:622
Run options: --seed 55322
# Running:
F
Failure:
MailerTest#test_reminders [/Users/maeda/redmines/trunk/test/unit/mailer_test.rb:628]:
"Bug #3: Error 281 when updating a recipe (5 days late)" not found in "1 issue(s) that are assigned to you are due in the next 42 days::
* eCookbook - Bug #3: Error 281 when updating a recipe (6 days late)
View all issues (2 open)
http://localhost:3000/issues?assigned_to_id=me&set_filter=1&sort=due_date%3Aasc
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://hostname/my/account
"
bin/rails test test/unit/mailer_test.rb:622
Finished in 1.727797s, 0.5788 runs/s, 2.3151 assertions/s.
1 runs, 4 assertions, 1 failures, 0 errors, 0 skips
</pre>
--------------------------------------------------------------------------------
When replacing Time with Date, @due_date@ was incorrect because timezone and time were truncated.
I rebuilt a test.
--------------------------------------------------------------------------------
Yuichi HARADA wrote:
> When replacing Time with Date, @due_date@ was incorrect because timezone and time were truncated.
> I rebuilt a test.
Thank you for updating the test. I wrote a simpler patch.
The root cause of the test failure is that a time zone is not set for users in test fixtures. Because of that, the time zone of users while running test depends on the timezone of the PC, and the result of test will be unstable.
This patch fixes the problem by fixing the user's time zone to UTC while running mailer_test.
--------------------------------------------------------------------------------
Go MAEDA wrote:
> The tests fail depending on the timezone.
>
> I think the error occurs when the date of the current timezone is different from the date in UTC. For example, I observed the following error on *20 May* 2019 08:15:00 +0900 (*19 May* 2019 23:15:00 UTC)
>
> [...]
Committed the fix #31225#note-12 in r18190.
--------------------------------------------------------------------------------
related_issues
relates,Closed,6357,Show and sort by due_date in reminders
relates,Closed,23778,default sort email reminders by due date (and list due date in email)