Insert date/time tool, \T\Z is zz

So I made this change which is very simple:

https://github.com/discourse/discourse/commit/c792f369668f418f99ded583fbfc72951525ccf3

Let me explain you more in details what are the reasons for what you had before. It’s true that zz and Z are similar to what you want to achieve, but TZ was a special token I added which would allow to show the timezone using a city name, which I think is clearer for some users not well versed in timezones.

The format was \T\Z and not TZ because it’s a special token and needed to be escaped so moment doesn’t try to replace the Z (this is what you see in your second example where you do LLLL TZ and you end up with T+01:00).

I decided few months ago to remove this to avoid having to support non standard things, but I guess I missed this occurrence as it was escaped two times in locale file: \\T\\Z which I probably fail to grep using single escaped query.

And finally, zz and Z are not deprecated, they have been removed from core moment, but are still very present in moment-timezone, so you can use them safely :+1:

5 Likes