This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Timezone offset bug #1261
Closed
Description
When I hit my site from a +1000 timezone and run the date through a $filter with the Z timezone formatter I get a -1000 timezone.
e.g.
var now = new Date(); // Fri Aug 10 2012 14:00:00 GMT+1000
var created = $filter('date')(now, "yyyy-MM-ddTHH:mm:ss.000Z");
Which equals:
"2012-08-10T14:00:00.000-1000"
I would expect it to equal:
"2012-08-10T14:00:00.000+1000"
If my understanding is not flawed, then this is the method that has the bug.
around line: 9805 (angular.js 1.0.1)
function timeZoneGetter(date) {
var offset = date.getTimezoneOffset();
return padNumber(offset / 60, 2) + padNumber(Math.abs(offset % 60), 2);
}