#11134 closed defect (fixed)
The Timezone in list view mode is UTC instead of req.tz.
Reported by: | Genie | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Component: | TicketCalendarPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
I think missing timezone conversion in function _parse_duration_arg().
def _parse_duration_arg(arg): default = datetime.now(utc).date(), 7 if not arg or '/P' not in arg: return default start, period = arg.split('/P', 1) try: start = parse_date(start, tzinfo=utc) except: start = None if not start: return default start = start.date() if period.endswith('D'): try: period = int(period[:-1]) except: period = 0 if period > 0: return start, period return default
Attachments (1)
Change History (15)
comment:1 follow-up: 2 Changed 11 years ago by
Status: | new → assigned |
---|---|
Trac Release: | → 0.12 |
comment:2 Changed 11 years ago by
Replying to jun66j5:
Indeed, the plugin has some issue for timezone.
It has some issues at am 00:00 ~ 09:00 in KST/JST timezone (UTC+9).
Changed 11 years ago by
Attachment: | timezone-issue.png added |
---|
This is result of run at 2013-06-03 01:36 in KST/JST timezone #2
comment:4 follow-up: 6 Changed 11 years ago by
The list view shows events from the first day to the last day in this week, not from today. Also, the first day of week is configurable with [ticketcalendar] first_week_day
.
comment:5 Changed 11 years ago by
Ah, I've misunderstood. You're right. I'll fix the problem in comment:2.
comment:6 follow-up: 7 Changed 11 years ago by
Replying to jun66j5:
The list view shows events from the first day to the last day in this week, not from today. Also, the first day of week is configurable with
[ticketcalendar] first_week_day
.
I think that the start_date is today by default, isn't it ?
and, today in list view mode is wrong displayed by timezone.
comment:7 Changed 11 years ago by
comment:8 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:10 Changed 11 years ago by
comment:11 Changed 11 years ago by
It still have Timezone issues: syntax date.today() The result of date.today() is depend on Server's local timezone. and it is diffent timezone.
comment:12 follow-up: 14 Changed 11 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Good catch! It should be datetime.now(req.tz).date()
instead.
comment:13 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:14 Changed 11 years ago by
Replying to jun66j5:
Good catch! It should be
datetime.now(req.tz).date()
instead.
Wow, very very speedy response!
I suppose that the string based date(start_date/due_date) seems to have logical timezone issue probably.
_parse_duration_arg()
returns a tuple of(date, period)
. Also,get_start_date()
andget_due_date()
ofTicketCalendarModule
return a date instance. The date instances has no timezone. So, the methods don't depend on user's timezone.However,
Milestone.due
is a datetime which has a timezone. Indeed, the plugin has some issue for timezone.