Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function zoneName() not match #5846

Open
do-ift opened this issue Mar 12, 2021 · 0 comments
Open

function zoneName() not match #5846

do-ift opened this issue Mar 12, 2021 · 0 comments

Comments

@do-ift
Copy link

do-ift commented Mar 12, 2021

Describe the bug
result of function moment().zoneName() not match.

To Reproduce
I have time with

_z:{
  abbrs: ["LMT", "PLMT", "+07", "+08", "+09", "+07", "+08", "+07", "+08", "+07"] (10)
  name: "Asia/Ho_Chi_Minh"
  offsets: [-426.6666666666667, -426.5, -420, -480, -540, -420, -480, -420, -480, -420] (10)
  population: 9000000
  untils: [-2004073600000, -1851577590000, -852105600000, -782643600000, -767869200000,
}

console.log(moment(time).zoneName()); // +07
console.log(moment(time).zoneAbbr()); // +07

Expected behavior
I think when I using zoneName, the result has been Asia/Ho_Chi_Minh

Additional context
I found on moment-timezone.js file
fn.zoneName = abbrWrap(fn.zoneName);

but

function abbrWrap (old) {
	return function () {
		if (this._z) { return this._z.abbr(this); }
			return old.call(this);
		};
	}

it return to abbr name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant