buggy loadingSchemes logic #64

Closed
jacobg opened this Issue Feb 14, 2013 · 3 comments

Comments

Projects
None yet
3 participants

jacobg commented Feb 14, 2013

Looks like the beginning of the init function should be:

def = this.loadingScheme === this.loadingSchemes.PRELOAD_ALL
          ? this.zoneFiles
          : this.loadingScheme === this.loadingSchemes.LAZY_LOAD
            ? (typeof this.defaultZoneFile === 'array'  || typeof this.defaultZoneFile === 'string' ? this.defaultZoneFile : 'northamerica')
            : def = [] // MANUAL_LOAD

instead of:

def = this.loadingScheme === this.loadingSchemes.PRELOAD_ALL
          ? this.zoneFiles
          : (this.defaultZoneFile ? this.defaultZoneFile : 'northamerica')
Collaborator

longlho commented Feb 14, 2013

what was the issue exactly? Can u provide some example snippets?

jacobg commented Feb 14, 2013

Without the above fix, the following code loads northamerica and not asia:

        // create shorter aliases for timezoneJS in global namespace
        tzjs = timezoneJS;
        tzjs.tz = tzjs.timezone;

        tzjs.tz.zoneFileBasePath = '/static/lib/tz';
        tzjs.tz.defaultZoneFile = 'asia';
        tzjs.tz.init();

@longlho longlho closed this in c7bbb60 Feb 14, 2013

Owner

mde commented Feb 14, 2013

Nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment