Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Date Format for Bootstrap-DatePicker

Tags:

Can anyone guide me for formatting date in Bootstrap-DatePicker.

And I used Eternicode/bootstrap-datepicker. Here my codes at JSP..

<div>Date : </div> <input type="text" style="width: 213px;" class="datepicker" > 

And at my JavaScript file...

    $('.datepicker').datepicker({     format: 'dd/mm/yyyy (D)',     autoclose: true,     keyboardNavigation : true ,     endDate : dateFormat(date, "dd/mm/yyyy (ddd)"),     daysOfWeekDisabled : [0] }); 

Output that I want to get as like 27/07/2013 (Sat) .

But output that show from my code as 27/07/2013 (Sat

I can't see close bracket " ) ". Any Suggestions ? Thanks in advance for all...

like image 850
Cataclysm Avatar asked Jul 27 '13 09:07

Cataclysm


2 Answers

Perhaps you can check it here for the LATEST version always

http://bootstrap-datepicker.readthedocs.org/en/latest/

$('.datepicker').datepicker({     format: 'mm/dd/yyyy',     startDate: '-3d' }) 

or

$.fn.datepicker.defaults.format = "mm/dd/yyyy"; $('.datepicker').datepicker({     startDate: '-3d' }) 
like image 127
Friend Avatar answered Oct 16 '22 12:10

Friend


I'm sure you are using a old version. You must use the last version available at master branch:

https://github.com/eternicode/bootstrap-datepicker

like image 27
amatellanes Avatar answered Oct 16 '22 10:10

amatellanes