Click here to Skip to main content
11,795,848 members (77,497 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: safari iOS iPad
I recently posted a question about formatting date inputs for IOS 5 safari. It works out so long as the date input is formatted YYYY-MM-DD. So february 22 2012 needs to be 2012-02-22 to work on an ipad. I simply overrode the jquery datepicker function to detect if it was an ipad, transform the date from mm-dd-yyyy to the ipad format before creating a date element to replace the text input.

Now however, the customer has asked that I change the value rendered out to the client and displayed to all users to display the above example date as 22/feb/2012, and they would like it to work correctly for 10 or so languages including Chinese, and Russian.

I can work it out for the standard browsers of IE, FF, and Chrome thanks to the awesomeness of jquery and its date picker. I don't see a clean way in my safari specific js for transforming to the date node, to handle transforming 05/jan/2012, 05/ene/2012, etc all back to 2012-01-05.

I could conceivably hack something together, but I am curious if anyone has an elegant solution, or knows something more about how safari handles the date node that I don't.
Posted 12-Jan-12 8:01am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 350
1 Sergey Alexandrovich Kryukov 326
2 KrunalRohit 239
3 Andy Lanng 236
4 OriginalGriff 230
0 OriginalGriff 1,852
1 Maciej Los 1,465
2 KrunalRohit 1,300
3 CPallini 840
4 Richard MacCutchan 828

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 12 Jan 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100