mde / timezone-js

DEPRECATED: Timezone-enabled JavaScript Date object. Uses Olson zoneinfo files for timezone data.
824 stars 183 forks source link

Preload zone file for specific timezone #93

Closed TrevorBurnham closed 11 years ago

TrevorBurnham commented 11 years ago

Suppose I only want to preload the zone file corresponding to the user's timezone, which I know at pageload. The problem is that I don't know which file that timezone corresponds to, and the getRegionForTimezone function isn't exposed. Is there a better way of solving this problem?

longlho commented 11 years ago

You can specify the timezoneJS.timezone.defaultZoneFile. There've been request to expose getRegionForTimezone so I think we can probably make it public. The other workaround would be to preload the tz yourself with new timezoneJS.Date :)

TrevorBurnham commented 11 years ago

Thanks for the response. I'd appreciate it if you'd make getRegionForTimezone public, as using that to get the value I want to set for timezoneJS.timezone.defaultZoneFile prior to init seems like the most straightforward solution.

mde commented 11 years ago

Published to NPM, v0.4.6.

TrevorBurnham commented 11 years ago

Excellent. Thanks for making this change so quickly.