#12689 closed defect (fixed)
Timeline shows incorrect date in heading
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.2 |
Component: | timeline | Version: | |
Severity: | normal | Keywords: | datetime |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Fixed timeline date headings not localized (regression in Jinja2 porting). |
Description (last modified by )
The server is something like +8 hours from my TZ and I've set my local timezone in preferences. The time is correct for the timeline entry but the date in the heading is +1 day. I tested the behavior with demo-1.2 and the issue isn't seen there.
Attachments (1)
Change History (10)
by , 8 years ago
Attachment: | Screen Shot 2017-02-14 at 17.27.32.png added |
---|
comment:1 by , 8 years ago
Description: | modified (diff) |
---|---|
Keywords: | datetime added |
comment:2 by , 8 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:3 by , 8 years ago
Release Notes: | modified (diff) |
---|
comment:4 by , 8 years ago
Be careful, I had a regression on this already, in the Jinja branch. Around the turn of the year, key_date
was format_date(date)
instead of format_date(date, format='iso8601')
, and we had some mix-up in the order of the days, with the January days coming after the December ones.
I just tried again with your changes, and the localization preferences set to "Date format: you language settings" and "Language: English/US":
- Mar 9, 2017:
- Mar 8, 2017:
- Mar 7, 2017:
- Mar 6, 2017:
- Mar 5, 2017:
- Mar 22, 2017: Today
- Mar 21, 2017: Yesterday
- Mar 20, 2017:
- Mar 2, 2017:
- Mar 19, 2017:
- …
comment:5 by , 8 years ago
Okay, we'll need to separate the presentation and sorting then. Current implementation has regressions:
- doesn't respect localization, neither timezone nor date format
- these comparisons always evaluate to false: trunk/trac/timeline/templates/timeline.html@15474:82-83#L81, because
today
andyesterday
are localized trunk/trac/timeline/web_ui.py@15649:146-147#L144
comment:6 by , 8 years ago
The changes in [945c6277/rjollos.git] pass truncated datetime
objects to the template and format the datetime
object in the template. I used a truncated datetime
object rather than a date
object because using a date
object introduces problems performing addition and subtraction between datetime
and date
objects.
comment:7 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed to trunk in r15713.
Proposed changes in [3b5bec52/rjollos.git].