mattbornski/tzwhere — pull request #3 by bigeasy (2012-06-25 22:04:10+00:00)
Title: Replace `time` with `bigeasy/timezone`.

Replace the C++ based time library with the pure JavaScript Timezone library, version 0.0.14. We'll use a frozen version number for Timezone while it's major version is the pre-release `0`.

Update `tzOffsetAt` to accept a wall-clock time, instead of only ever using `Date.now()`. The wall-clock time is passed to the Timezone function as an array of date filed, along with the time zone name and a custom format specifier. The custom format specifier returns the time zone offset in milliseconds. The Timezone function returns the output of the custom format specifier which is converted to integer and returned from `tzOffsetAt`.

Removed fixup for incorrect time zone offset.

Update `dateIn` to use a date field array and a time zone to convert wall-clock time to POSIX time.

Note that the `dateIn` and `tzOffsetAt` follow the `new Date` convention of interpeting a single argument as POSIX time. To specify the first of the year, you must specify at least the year and the month. Any field left null is zero filled.

Timezone uses a one-based month number, so we need to convert this.

Also, if you pass in a single argument that is an RFC 3999 date string, `dateIn` and `tzOffsetAt` will parse it as wall-clock time, fi the date string does not explicitly specify a time zone offset.

Nonsense gets you `null`.

Current tests passing on Fedora 16.

Related issues: mattbornski/tzwhere#2.