c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
JQuery

Changing date format in jQuery ui datepicker

| | Html , JQuery

In this tutorial I will show you how to change date format in jQuery ui datepicker. To initialize we need to import jQuery libraries. Create the input element and name it and in script section initialize the datepicker with dateformat options. 

DatePicker Example:


<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>DatePicker
Format Example
</title>
    <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
    <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(document).ready(function () {
                $("#dtpStartDate").datepicker({
                    dateFormat: 'dd-mm-yy'
                });
            });
        });
    </script>
 
</head>
<body>
    <h2>DatePicker
Format Example
</h2>
 
    <input id="dtpStartDate" /><br />
</body>
</html>

Video Guide: