Solved

How to change Bootstrap Datepicker Format ?

Posted on 2016-10-24
1
55 Views
Last Modified: 2016-10-26
Hi Experts,

We are trying with datepicker to change the format . But when we give jquery to set the format its not working at all . Here is my code
<input name="txtDate" type="text" value="25-10-2016" id="txtDate" class="hasDatepicker">

Open in new window


Js Script
    $(function () { 
            $("#txtDate").datepicker({ dateFormat: 'dd-mm-yy' });

        })

Open in new window

0
Comment
Question by:karthik80c
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 41859268
try this :

$(function () {
            $("#txtDate").datepicker({ format: 'dd-mm-yy' });

        })
1

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question