moment-timezone icon indicating copy to clipboard operation
moment-timezone copied to clipboard

Missing time zone data still uses local time zone instead of invalid date

Open winweb opened this issue 10 years ago • 4 comments

I test on http://jsfiddle.net/win_web/uq99udc9/3/

I compare with America/Los_Angeles time.

both timezone had same result.

Asia/Bangkok timezone used GMT+7.

winweb avatar Oct 29 '15 09:10 winweb

You did not load any time zone data. I updated your fiddle by using the moment-timezone-with-data-2010-2020.min.js file instead of moment-timezone.min.js, and it works fine.

However, I thought we had taken care of that with #106. Apparently there's been a regression.

mattjohnsonpint avatar Oct 29 '15 22:10 mattjohnsonpint

Ok, if you look at your original fiddle (not my updated copy), open the F12 developer tools and you'll see the error message on the console.

HOWEVER, despite the error, the format function still used the local time zone, rather than showing "Invalid Date".

@timrwood - any thoughts?

mattjohnsonpint avatar Oct 29 '15 22:10 mattjohnsonpint

@mj1856 thanks for you suggest and update my fiddle.

winweb avatar Oct 30 '15 02:10 winweb

I'd like to leave this open to track the problem of it not returning an invalid date message.

mattjohnsonpint avatar Oct 30 '15 04:10 mattjohnsonpint