Feature #31225
closedShow the number of days left until the due date in reminders
0%
Description
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)
Files
Related issues
Updated by Go MAEDA over 5 years ago
I noticed a few weeks ago that reminders from Planio already has the information. It is really useful.
Updated by Go MAEDA over 5 years ago
- Related to Patch #6357: Show and sort by due_date in reminders added
Updated by Go MAEDA over 5 years ago
- Related to Feature #23778: default sort email reminders by due date (and list due date in email) added
Updated by Yuichi HARADA over 5 years ago
+1
I think it is useful because I can understand the number of days until the due date.
I attached a patch.
Updated by Go MAEDA over 5 years ago
- Target version set to Candidate for next major release
Updated by Go MAEDA over 5 years ago
- Target version changed from Candidate for next major release to 4.1.0
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.
Updated by Go MAEDA over 5 years ago
- Subject changed from Show how many days are left until the due date in reminders to Show the number of days left until the due date in reminders
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patch. Thanks.
Updated by Go MAEDA over 5 years ago
- Status changed from Closed to Reopened
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)
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
Updated by Yuichi HARADA over 5 years ago
- File 31225_fix_test.patch 31225_fix_test.patch added
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.
Updated by Go MAEDA over 5 years ago
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.
$ 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
Updated by Yuichi HARADA over 5 years ago
- File 31225_fix_test_v2.patch 31225_fix_test_v2.patch added
When replacing Time with Date, due_date
was incorrect because timezone and time were truncated.
I rebuilt a test.
Updated by Go MAEDA over 5 years ago
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.
Updated by Go MAEDA over 5 years ago
- Status changed from Reopened to Closed
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.