iOS support

The solution has been taken from: http://stackoverflow.com/questions/5324178/javascript-date-parsing-on-iphone