Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change bootstrap datepicker date format on select

I'm using bootstrap datepicker on a textbox. The default format of the date when you select a date is mm/dd/yyyy. Now I want to change it to dd/mm/yyyy. How can I accomplish this. Right now I'm just initializing it just like this.

$('.datepicker').datepicker() 

What should I add to change its format?

like image 739
Luke Villanueva Avatar asked Nov 15 '13 03:11

Luke Villanueva


People also ask

How do I change the datepicker format in bootstrap?

In order to set the date format, we only need to add format of one argument and then we will add our required format, which is shown in the following example: Example 1: In this example, we are going to use dd-mm-yyyy format.

How do I change date format in datepicker?

In the Data type Format dialog box, do one of the following: To format the control to show the date only, select the display style that you want in the Display the date like this list. To format the control to show the time only, select the display style that you want in the Display the time like this list.

How can I change datepicker format DD MMM YYYY?

The jQuery DatePicker plugin supports multiple Date formats and in order to set the dd-MMM-yyyy Date format, the dateFormat property needs to be set. The following HTML Markup consists of a TextBox which has been made Read Only.


1 Answers

See http://www.eyecon.ro/bootstrap-datepicker/

 $('.datepicker').datepicker({     format: 'dd/mm/yyyy'  }); 
like image 62
unlimit Avatar answered Sep 20 '22 17:09

unlimit