Repository navigation
Conversation
As described in issue #3020, a moment in UTC mode should be formatted, by default, with the letter Z as a suffix instead of the time zone, +00:00.
|
+1 on the implementation. The only other possibility to consider is whether it makes sense to have a Z-like token that formats "Z" or a numerical offset based on whether it's UTC or not and then use that token in the ISO format; i.e. move the But I think it's probably fine as-is. |
|
@icambron I like the idea of using a token since it's more generic and would work with any kind of formatting, not just the default. I think this can be done by editing moment/src/lib/units/offset.js Line 20 in b135bf1 |
|
Just a heads up on this PR. I think if this gets merged, it's going to exacerbate the effect of moment/moment-timezone#312 . Dates in London time, without BST, are going to start being formatted with an offset of |
|
@maggiepint - right. let's fix it in moment proper, then address the moment-timezone side. Even if times in London are temporarily formatted with a Also - I don't think it matters to us, but worth mentioning that RFC3339 allows |
|
After |
|
Merged in 5a93650 |
Using Z suffix when in UTC mode (#3020)
|
We actually got bitten by a bug caused by this change in production :( The quick fix was: We send a date to an external API using The external API parsed the format |
|
@leolannenmaki - Thanks for the feedback, and sorry to hear this caused a production bug for you. However, I'd suggest that since both |
|
No worries :) I completely agree that the external API has a bug in this case. I think it's using some old PHP lib to parse the date. The problem is just that we don't have control over it. I'd just like you guys to consider in the future that these kind of bugfixes / conforming to the spec can also be backward incompatible major changes in a sense. My message was more of a heads up that this can be an issue to some users. |
|
I also got bitten in production by this update as utc dates no longer adhere to |
|
@paulfalgout - sorry for the trouble. Sometimes the line between "bug fix" and "breaking change" is fuzzy. |
As described in issue #3020, a moment in UTC mode
should be formatted, by default, with the letter Z
as a suffix instead of the time zone, +00:00.