mde / timezone-js

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

Preparsed offset string issues #154

Closed iamnoah closed 9 years ago

iamnoah commented 10 years ago

Fixes #152. Everywhere I can see tzOffset being used, it is expected to a be a number. But node-preparse ensures that it will be a string. e.g.,

    "Asia/Seoul": [
      [
        "-507.8666666666667",
        "-",
        "LMT",
        "-2493072000000"
      ],
      [
        "-510",
        "-",
        "KST",
        "-2053900800000"
      ],
      [
        "-540",
        "-",
        "KST",
        "-1293926400000"
      ],
      [
        "-510",
        "-",
        "KST",
        "-1167696000000"
      ],
      [
        "-540",
        "-",
        "KST",
        "-498096000000"
      ],
      [
        "-480",
        "ROK",
        "K%sT",
        "-264902400000"
      ],
      [
        "-510",
        "-",
        "KST",
        "-39484800000"
      ],
      [
        "-540",
        "ROK",
        "K%sT",
        null
      ]
    ],

I would add a test case, but jake dies on me when I try to test it. Use preparsed data and setTimezone will cause the error.

mde commented 10 years ago

I can't see how node-preparse was even working at all. Could you pull in the fixes in master and see how the tests run for you?

sdemjanenko commented 9 years ago

I think this commit needs to be pulled in ASAP. I just got bit by this for Australia/Queensland.

mde commented 9 years ago

Happy to, if we can get the tests passing. Any chance you could pull in the fixes in master and see if we get a green light?

sdemjanenko commented 9 years ago

I submitted a pull request #160. All the tests pass when I run npm test locally.

mde commented 9 years ago

Fixed via #160.