Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#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 13 years ago by dylan

Milestone: 0.4
Owner: changed from anonymous to dylan
Status: newassigned

assigning to myself for 0.4 ... we need to put some real efforts into cleaning up timezones, etc.

comment:2 Changed 13 years ago by dylan

Resolution: fixed
Status: assignedclosed

fixed in [4423]

comment:3 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.