1

After updating (to 0.5.x) moment-timezone facing issue with abbreviation which used to work fine earlier (0.3.x)

Following is the code to test:

var moment = require('moment');
var momentTz = require('moment-timezone');
var now = 
moment.tz(new Date('Thu Sep 14 2017 07:32:17 GMT+0000 (UTC)'),'Asia/Dubai');
console.log("now.zoneAbbr()");
console.log(now.zoneAbbr());
console.log("now.zoneName()");
console.log(now.zoneName());
console.log("format");
console.log(now.format('ha z'));
console.log(now)

Moment-TimeZone Version "0.3.1": Output:

now.zoneAbbr()
GST
now.zoneName()
GST
format
11am GST
moment.parseZone("2017-09-14T11:32:17.000+04:00")

Moment-TimeZone Version "0.5.x": Output:

now.zoneAbbr()
+04
now.zoneName()
+04
format
11am +04
moment.parseZone("2017-09-14T11:32:17.000+04:00")

I believe something is wrong in my understanding if this is a betterment of moment-timezone or I think the problem is in this change /moment-timezone/data/packed/latest.json
e.g. version 0.5.x (Line No.188)

"Asia/Dubai|LMT +04|-3F.c -40|01|-21JfF.c|39e5"

e.g. version 0.3.x (Line No.188)

"Asia/Dubai|LMT GST|-3F.c -40|01|-21JfF.c"

Could anyone put some more light on this issue?

Amol M Kulkarni
  • 21,143
  • 34
  • 120
  • 164

0 Answers0