#916 closed defect (fixed)
dojo.date.format, dojo.date.strftime %z sign is wrong
Reported by: | anonymous | Owned by: | dylan |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | General | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When passing the %z formatting option to dojo.date.format or date.strftime, the result has the wrong sign. For example, calling dojo.date.format(someDate, "%z") on a PDT date will return "+07:00". It should return "-07:00".
The fix is simple. Change:
case "z": // time zone or name or abbreviation var timezoneOffset = dateObject.getTimezoneOffset(); return (timezoneOffset < 0 ? "-" : "+") +
to:
case "z": // time zone or name or abbreviation var timezoneOffset = dateObject.getTimezoneOffset(); return (timezoneOffset > 0 ? "-" : "+") +
i.e., change the < to a >
Change History (3)
comment:1 Changed 15 years ago by
Milestone: | → 0.4 |
---|---|
Owner: | changed from anonymous to dylan |
Status: | new → assigned |
Note: See
TracTickets for help on using
tickets.
assigning to myself for 0.4 ... we need to put some real efforts into cleaning up timezones, etc.