API Controls API Controls - 2 months ago 9
jQuery Question

Change Date Format Of Jquery Datepicker

I want to change the date format to

dd-MM-yyyy
currently the date format of my jquery calender extender is 'MM-dd-yyyy'

below is my

<input class="inputDate" formated="true" id="inputDate" value="12/12/2008" />


and i tried the following function to change the date format but it is not working

<script>
var date = $('#inputdate').datepicker({ dateFormat: 'dd-mm-yy' }).val();
</script>

Answer
<!doctype html> <html lang="en">    <head>
      <meta charset="utf-8">
      <title>jQuery UI Datepicker functionality</title>
      <link href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet">
      <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
      <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
      <!-- Javascript -->
      <script>
         $(function() {
            $( "#datepicker-3" ).datepicker({
               dateFormat:"dd-mm-yy",
               altField: "#datepicker-4",
               altFormat: "DD, d MM, yy"
            });
         });
      </script>    </head>    <body>
      <!-- HTML --> 
      <p>Enter Date: <input type="text" id="datepicker-3"></p>

   </body> </html>

Hey Brother Try This TextBox From Jquery-UI

Comments