jackgoddy123 Posted January 17, 2014 Share Posted January 17, 2014 Hello, I have the below code with generate date format calender. It properly works for mm/dd/yy format <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Default functionality</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(function() { $( "#datepicker" ).datepicker(); }); </script> </head> <body> <p>Date: <input type="text" id="datepicker"></p> </body> </html> But i want datepicker in dd/mm/yy format. i.e 24/01/14 (dd/mm/yy) format Can some one help me out. I am quite stuck. Any kind of help is appreciated. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted January 17, 2014 Share Posted January 17, 2014 i'm betting this is covered in the documentation. have you consulted the documentation? Quote Link to comment Share on other sites More sharing options...
Barand Posted January 20, 2014 Share Posted January 20, 2014 (edited) A couple of minutes Googling gave $(function() { $( "#datepicker" ).datepicker({dateFormat: 'dd/mm/y'}); }); However, I prefer to use "d-M-y" format for datepickers. It's unambiguous about which is the month and which is the day (unlike 04/05/14) and it still works fine with strtotime() unlike d/m/y format Edited January 20, 2014 by Barand Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.