mde / timezone-js

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

Fix Incorrect "Link" parsing #147

Closed SlexAxton closed 10 years ago

SlexAxton commented 10 years ago

The parser was trying to treat the "Link" values as a number. By casting the strings (the desired type) to a number, the result became "NaN" (the string). This should clear it up.

SlexAxton commented 10 years ago

Ah I see the commit this happened in : https://github.com/mde/timezone-js/commit/a41d18b6ab3261e99785a8569ee1489262d29dba : was for #125 - Let me see if I can't bridge the gap.

SlexAxton commented 10 years ago

So I changed this to check the conversion now to make sure we weren't creating a NaN situation. However, I'm not entirely sure that #125 is fixed by this, since this only deals with 'Link' lines, as far as I can tell.

mde commented 10 years ago

I think this is probably fine. But a couple of small tweaks would be helpful -- I don't think you need to parseInt inside the isNaN check. Anything string that returns false for isNaN should be parseInt-able, right? Also probably should include the radix in the parseInt call. :)

SlexAxton commented 10 years ago

done.

mde commented 10 years ago

THANKS :D

mde commented 10 years ago

Pushed to NPM, v0.4.11.