Here I will post problems I and my colleagues met and solutions we found.

Tuesday, August 14, 2007

parseInt surprise

It turned out I couldn't make it with my project. However, I still see some problems where solutions are either not obvious for me from documentation, or I just couldn't find them there. And it could be not even related to .NET. I decided to put them here anyway.

Here is one of them. I developed Gmail notifier plugin for Google Desktop. This was my first and currently the only project in Javascript. One of the problem I had was with parseInt function. It turned out that the function is very smart, and trying to figure out what base should be used. And since I tried to parse month or day from the date, I had leading zeros. That made the function think the base is 8, so numbers '08' and '09' could not be parsed.

Thanks to http://www.faqts.com/knowledge_base/view.phtml/aid/8108

No comments: