#12348 closed defect (fixed)
Now button in datetime picker use wrong time when timezones are different between Trac and browser
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.2 |
Component: | i18n | Version: | |
Severity: | normal | Keywords: | datepicker timezone jquery jqueryui |
Cc: | walty8@… | Branch: | |
Release Notes: |
Fixed now button in jQuery timepicker not using session timezone preference. |
||
API Changes: |
Upgraded:
|
||
Internal Changes: |
Description
Now button in datetime picker uses Date()
with browser's timezone to fill. If a user configure different timezone, the datetime picker fills wrong time.
This issue would be fixed by the following patch with jQuery-Timepicker-Addon v1.6.0. v1.5.5 is used in trunk.
-
trac/web/chrome.py
diff --git a/trac/web/chrome.py b/trac/web/chrome.py index a6b8d986c..dc2a1a848 100644
a b class Chrome(Component): 1379 1379 is_iso8601 = req.lc_time == 'iso8601' 1380 1380 now = datetime_now(req.tz) 1381 1381 tzoffset = now.strftime('%z') 1382 if is_iso8601: 1383 default_timezone = (-1 if tzoffset.startswith('-') else 1) * \ 1384 (int(tzoffset[1:3]) * 60 + int(tzoffset[3:5])) 1385 timezone_list = get_timezone_list_jquery_ui(now) 1386 else: 1387 default_timezone = None 1388 timezone_list = None 1382 default_timezone = (-1 if tzoffset.startswith('-') else 1) * \ 1383 (int(tzoffset[1:3]) * 60 + int(tzoffset[3:5])) 1384 timezone_list = get_timezone_list_jquery_ui(now) \ 1385 if is_iso8601 else None 1389 1386 add_script_data(req, jquery_ui={ 1390 1387 'month_names': get_month_names_jquery_ui(req), 1391 1388 'day_names': get_day_names_jquery_ui(req),
Attachments (0)
Change History (23)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Okay. Updated log:jomae.git@t12348 with jQuery 1.12.0 and also jQuery-Timepicker-Addon 1.6.1 (latest).
comment:3 by , 9 years ago
Milestone: | next-dev-1.1.x → 1.2 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:4 by , 9 years ago
I did some testing with Chrome 48 and found two minor issues that are not present on the trunk:
- The Today button on the datepicker is not effective.
- On attempting to manually edit a datetime (e.g. Milestone edit page), focus is lost after editing a single character. This even happens when deleting a single character.
comment:5 by , 9 years ago
Milestone: | 1.2 → next-dev-1.1.x |
---|
Another issue: Now button works well first time. However, it fills incorrect time on clicking it once again. It needs more tests….
comment:8 by , 9 years ago
Milestone: | next-stable-1.2.x → 1.2 |
---|
follow-up: 17 comment:10 by , 8 years ago
Rebased jomae.git@t12348 and updated to jQuery 1.12.4 and jQuery-Timepicker-Addon 1.6.3. The issue in comment:5 has been fixed. However, Today button in datepicker isn't still working.
I tried datepicker without timepicker addon on http://jqueryui.com/datepicker/#buttonbar. The Today button in original datepicker doesn't work….
comment:11 by , 8 years ago
Cc: | added |
---|
comment:12 by , 8 years ago
I haven't tested the comment:10 branch, but to summarize we are currently using jQuery 1.11.3 (lastest release on 1.11.x line) and jQuery UI 1.11.4 (the latest jQuery UI). If the Today button breaks with jQuery 1.12.4 (the latest release of the 1.x line), then I guess there must be a compatibility problem between jQuery UI 1.11.4 and jQuery 1.12.4?
I suppose sticking with jQuery 1.11.3 is not so bad, but it would be really nice to move to the latest jQuery 1.x by Trac 1.2, considering that in the past we've only upgraded jQuery to a major release on a major release of Trac.
I will try to spend some time on it before the weekend, since I hope to create 1.2rc1 this weekend.
comment:13 by , 8 years ago
Milestone: | 1.2 → 1.3.1 |
---|
comment:15 by , 7 years ago
Milestone: | next-dev-1.3.x → 1.3.3 |
---|
Moving to 1.3.3 since we should upgrade jQuery and jQuery UI before releasing Trac 1.4.
comment:16 by , 7 years ago
API Changes: | modified (diff) |
---|
comment:17 by , 7 years ago
Replying to Jun Omae:
Rebased jomae.git@t12348 and updated to jQuery 1.12.4 and jQuery-Timepicker-Addon 1.6.3. The issue in comment:5 has been fixed. However, Today button in datepicker isn't still working.
Discussed in SO:1076274/121694. The solution in SO:10094319/121694 looks good to me.
Changes rebased and jQuery-UI updated in log:rjollos.git:t12348.1. I'll do more testing. I'd like to commit the changes soon so that we have as much testing time as possible before the release of Trac 1.4.
comment:18 by , 7 years ago
font-family in jquery-ui.css has many backslash characters:
$ git grep font-family: t12348.1:trac/htdocs/css/jquery-ui/jquery-ui.css t12348.1:trac/htdocs/css/jquery-ui/jquery-ui.css: font-family: Verdana,Arial,\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'Bitstream Vera Sans\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\',Helvetica,sans-serif; t12348.1:trac/htdocs/css/jquery-ui/jquery-ui.css: font-family: Verdana,Arial,\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'Bitstream Vera Sans\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\',Helvetica,sans-serif;
comment:19 by , 7 years ago
Issue was fixed previously in r11685. Fixed in TracDev/JavaScript@13 and [fc0f1de0/rjollos.git].
comment:20 by , 7 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed to trunk in [16094:16095].
comment:21 by , 7 years ago
Milestone: | 1.3.3 → 1.3.2 |
---|
comment:22 by , 7 years ago
Keywords: | jquery jqueryui added |
---|
comment:23 by , 5 years ago
Release Notes: | modified (diff) |
---|
Replying to Jun Omae:
It seems like a good idea to update the addon again before we release Trac 1.2. We could also consider moving from jQuery 1.11.3 to 1.12.0. jQuery UI 1.11.4 is still the latest.