-
Notifications
You must be signed in to change notification settings - Fork 27.5k
date filter not adding appropriate + / - sign for 'Z' timezone offset resulting in invalid ISO 8601 #1532
Comments
Hmm, just tested in CET (UTC+1) and properly getting |
Still incorrect for my timezone per the fiddle above. |
@TraeRegan I think you are right, there is something fishy going on here... According to http://en.wikipedia.org/wiki/ISO_8601:
and then
So in my case (GMT+1) it looks like it should be giving On top of this the |
This commit fixes angular#1261 and angular#1532. This covers two separate issues: - Positive timezones were being formatted without a leading `+` resulting in a formatting string like: "HH:MM:ssZ" giving "12:13:141000" instead of "12:13:14+1000". Fixed by checking if timezone is > 0 and adding a leading "+". - Timezone output signs were inverted. mock.TzDate expects the timezone _offset_ as it's first argument, _not_ the timezone. This means that a mock.TzDate with a positive offset should result in a date string with a negative timezone, and vice-versa.
This commit fixes angular#1261 and angular#1532. This covers two separate issues: - Positive timezones were being formatted without a leading `+` resulting in a formatting string like: "HH:MM:ssZ" giving "12:13:141000" instead of "12:13:14+1000". Fixed by checking if timezone is > 0 and adding a leading "+". - Timezone output signs were inverted. mock.TzDate expects the timezone _offset_ as it's first argument, _not_ the timezone. This means that a mock.TzDate with a positive offset should result in a date string with a negative timezone, and vice-versa.
This commit fixes angular#1261 and angular#1532. This covers two separate issues: - Positive timezones were being formatted without a leading `+` resulting in a formatting string like: "HH:MM:ssZ" giving "12:13:141000" instead of "12:13:14+1000". Fixed by checking if timezone is > 0 and adding a leading "+". - Timezone output signs were inverted. mock.TzDate expects the timezone _offset_ as it's first argument, _not_ the timezone. This means that a mock.TzDate with a positive offset should result in a date string with a negative timezone, and vice-versa.
This commit fixes angular#1261 and angular#1532. This covers two separate issues: - Positive timezones were being formatted without a leading `+` resulting in a formatting string like: "HH:MM:ssZ" giving "12:13:141000" instead of "12:13:14+1000". Fixed by checking if timezone is > 0 and adding a leading "+". - Timezone output signs were inverted. mock.TzDate expects the timezone _offset_ as it's first argument, _not_ the timezone. This means that a mock.TzDate with a positive offset should result in a date string with a negative timezone, and vice-versa. Closes angular#1261, angular#1532
This commit fixes #1261 and #1532. This covers two separate issues: - Positive timezones were being formatted without a leading `+` resulting in a formatting string like: "HH:MM:ssZ" giving "12:13:141000" instead of "12:13:14+1000". Fixed by checking if timezone is > 0 and adding a leading "+". - Timezone output signs were inverted. mock.TzDate expects the timezone _offset_ as it's first argument, _not_ the timezone. This means that a mock.TzDate with a positive offset should result in a date string with a negative timezone, and vice-versa. Closes #1261, #1532
fixed by b001c8e |
See jsfiddle example here: http://jsfiddle.net/traeregan/C82QB/
e.g. the output I get in EDT is:
2012-11-06T01:29:290500
But it should be:
2012-11-06T01:29:29-0500
The text was updated successfully, but these errors were encountered: