Issue 783: formatDate('u') incorrectly outputs local times with UTC "Z"
Status:  Released
Owner: ----
Closed:  Jun 2014
Reported by bdstark, Jan 5, 2011
When using the 'u' dateFormatter, a 'Z', indicating UTC, is always placed at the end of the string instead of the local time zone offset.

I modified the dateFormatters method, changing the u formatter and adding a TZO formatter, along with a new function zeroPadSign:
u	: function(d)	{ return formatDate(d, "yyyy-MM-dd'T'HH:mm:ssTZO") },
TZO	: function (d) {
		var minOffset = d.getTimezoneOffset();
		var hours = -1 * Math.floor(minOffset / 60);
		var minutes = minOffset % 60;
		var offset = zeroPadSign(hours) + ':' + zeroPad(minutes);
		return offset;
	}

function zeroPadSign(n) {
        if (n >= 0) { return '+' + zeroPad(n); }
        else { return '-' + zeroPad(Math.abs(n)); }
    }

These add the proper offset (-07:00 for MNT here) to the string.  I did not explicitly check if the date was in UTC however - I think the proper behavior would be to add the 'Z' for an explicit UTC date object, but an offset of -00:00 or +00:00 for anything else that has the same time as UTC (GMT is all I can think of), so that still would need to be added.

Using 1.4.10.

Brian
Feb 12, 2011
Project Member #1 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Discussing
Feb 15, 2011
Project Member #2 adamrs...@gmail.com
(No comment was entered for this change.)
Summary: formatDate for ISO8601 ('u') should include timezone offset
Status: Maybe
Aug 13, 2013
Project Member #3 adamrs...@gmail.com
(No comment was entered for this change.)
Summary: ISO8601 in local time, for formatDate (was: formatDate for ISO8601 ('u') should include timezone offset)
Status: Accepted
Labels: Type-Feature
Aug 15, 2013
Project Member #4 adamrs...@gmail.com
 Issue 1327  has been merged into this issue.
Aug 15, 2013
Project Member #5 adamrs...@gmail.com
as @zippidyzap points out in  issue 1327 , this is more of a "bug" than a feature request because the "Z" represent UTC time, and this function falsely represents that. All the values in the output are simply the local values, with a Z appended. Bad.
Summary: formatDate('u') incorrectly outputs local times with UTC "Z" (was: ISO8601 in local time, for formatDate)
Labels: -Type-Feature Type-Bug
Sep 1, 2013
Project Member #6 adamrs...@gmail.com
(No comment was entered for this change.)
Labels: milestone-date
May 25, 2014
Project Member #7 adamrs...@gmail.com
this bug no longer applies in v2 (in github, v2 branch). not yet officially released though
Status: Implemented
Jun 2, 2014
Project Member #8 adamrs...@gmail.com
version 2 has been released with this change.
http://blog.arshaw.com/1/post/2014/06/fullcalendar-2-released.html
Status: Released