mde / timezone-js

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

preparse.js doesn't work #59

Closed mattjohnsonpint closed 11 years ago

mattjohnsonpint commented 11 years ago

I followed the instructions to preparse the tzdb data using preparse.js. The script didn't run at all. It got caught on this:

load('../../src/json.js');
var _tz = fleegix.date.timezone;

I pulled in fleegix and changed the path to point at json.js properly, then update the name of the library. (I'm guessing this is an old script that is out of sync with current changes)

load('src/json.js');  // where I have fleegix source dir
var _tz = timezoneJS.timezone;

Then the script ran, and built the json file. However, it wouldn't work in the current code. I dug in further and found that the json has a lot of arrays ending with undefined data:

["2:00",2,0,0,"undefined"]

I manually (search/replace) took out all of those so those data elements, making it look like

["2:00",2,0,0]

Then it worked. I dug through the script, but I can't seem to find how these extra fields are getting created.

longlho commented 11 years ago

try node-preparse.js instead. fleegix is not currently maintained I believe.