School is a twelve-year jail sentence where bad habits are the only curriculum truly learned.
John Taylor Gatto
New forum topics
Recent comments
- found OpenCMS better than
19 weeks 2 days ago - For me it was citype not
19 weeks 3 days ago - I would rather not worry
19 weeks 6 days ago - Hi there ,
i have integrate
21 weeks 13 hours ago - Works a treat. I recommend
22 weeks 4 days ago - Any updates on a Drupal 6
24 weeks 3 days ago - Are you people really that
24 weeks 5 days ago - video display quality in
26 weeks 1 day ago - yes it's true. joomla is hard
26 weeks 1 day ago - About Twitter.
26 weeks 5 days ago
Writing a simple Javascript function to create a Date object from a 'yyyy-mm-dd' string I found a small, but important, issue with the parseInt function, used to transform strings to integers.
Both parseInt('08') and parseInt('09') return zero because the function tries to determine the correct base for the numerical system used. In Javascript numbers starting with zero are considered octal and there's no 08 or 09 in octal, hence the problem.
To fix this just add the second parameter for parseInt, the base to be used for the conversion. The correct calls should be parseInt('08', 10) and parseInt('09', 10).
Another of those little details, uh?


Join the conversation
nice addition
thanks for the tip! im always using the php version for creating data object, but this is certainly handy too.
Regards,
Aislin
Good Tip.
Good Tip.
This is very good thing to
This is very good thing to catch these type of special cases. Thank you very much.