moment-timezone link of link issue
When attempting to create a link of a time zone that is already an alias, the zone will not resolve.
by clayzermk1
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.4/moment-timezone-with-data-2010-2020.min.js"></script>
<h3>
See console.
</h3>
JavaScript
/* Attempting to create a link of an official time zone link will not resolve the zone when queried. I referenced https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the links. */
moment.tz.link([
// Non-linked time zones
'London Town|Europe/London',
'Aloha|Pacific/Honolulu',
// Linked time zones
'The Best Cows|Europe/Jersey', // official link of Europe/London
'Island Style|Pacific/Johnston' // official link of Pacific/Honolulu
]);
// moment.tz.zone() will resolve to a Zone - no problem
var london = (moment.tz.zone('London Town') instanceof moment.tz.Zone);
var honolulu = (moment.tz.zone('Aloha') instanceof moment.tz.Zone);
// moment.tz.zone() returns null - here's the problem
var jersey = (moment.tz.zone('The Best Cows') instanceof moment.tz.Zone);
var johnston = (moment.tz.zone('Island Style') instanceof moment.tz.Zone);
console.log(london, honolulu, jersey, johnston);