RSSAmplifier

Duncan McDougall | Web Developer · Aug 7, 2012

iOS Date Parsing Issue

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

The following code works in web browsers but returns "Invalid Date" on iOS 5. I noticed while building a PhoneGap based app. // This returns invalid date in iOS. var yearMonth = "2012-08" ; var date = new Date ( yearMonth ) ; document . write ( date ) ; Solution Split the string into parts and pass in the first two items of the array. Since January is 0 and December is 11, remember to take 1 from…

Read on belter.io

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.