Merge ~cjwatson/launchpad:date-widget-time-zone-name into launchpad:master
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 64219c788bd9554f6b45ea3d4ecdfbdc9929ce72 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:date-widget-time-zone-name |
Merge into: | launchpad:master |
Diff against target: |
420 lines (+86/-72) 7 files modified
lib/lp/app/widgets/date.py (+44/-46) lib/lp/app/widgets/templates/datetime.pt (+1/-1) lib/lp/blueprints/browser/sprint.py (+7/-7) lib/lp/blueprints/browser/sprintattendance.py (+5/-5) lib/lp/services/webapp/doc/launchbag.rst (+14/-7) lib/lp/services/webapp/interfaces.py (+1/-0) lib/lp/services/webapp/launchbag.py (+14/-6) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guruprasad | Approve | ||
Review via email: mp+443006@code.launchpad.net |
Commit message
Refactor time zone name handling in DateTimeWidget
Description of the change
`DateTimeWidget` currently works out the time zone name to display by calling `.tzname(None)` on a time zone object. This works with `pytz`, but it won't work once we switch to `dateutil.tz`, and there doesn't seem to be a reasonable way to get it to work with that time zone provider without poking about in private attributes; the best we could do would return a time zone abbreviation string rather than the original time zone name the user asked for (e.g. "CET" rather than "Europe/Paris"), which isn't very satisfactory.
Since the whole approach of expecting to be able to recover the original time zone name from a time zone object seems fundamentally dodgy, a better approach is to explicitly keep track of the original time zone name to start with. This needs some changes to `LaunchBag`, but the result should be much more robust and can easily be made to work with any time zone provider.
LGTM ๐๐ผ