bootstrap DatePicker can't display on swedish -


i'm using datepicker bootstrap https://bootstrap-datepicker.readthedocs.org/en/latest/

but want months / dates in sweden went javascript , did change following line: language: 'en',too language: 'sv',

but datepicker looks this:

enter image description here

datepicker settings:

    var defaults = $.fn.datepicker.defaults = {     autoclose: true,     beforeshowday: $.noop,     beforeshowmonth: $.noop,     calendarweeks: false,     clearbtn: false,     toggleactive: false,     daysofweekdisabled: [],     datesdisabled: [],     enddate: infinity,     forceparse: true,     format: 'yyyy-mm-dd',     keyboardnavigation: true,     language: 'sv',     minviewmode: 0,     multidate: false,     multidateseparator: ',',     orientation: "auto",     rtl: false,     startdate: -infinity,     startview: 0,     todaybtn: false,     todayhighlight: false,     weekstart: 1,     disabletouchkeyboard: false,     enableonreadonly: true,     container: 'body' }; 

my datepicker(s) in view:

    $(function () {     $(function () {         $('#fromdate').datepicker({             showbuttonpanel: true,             changemonth: true,             changeyear: true,             dateformat: "yy-mm-dd",             firstday: 1,             onselect: function (datetext) {                 $('#enddate').datepicker('option', 'mindate', new date(datetext));             }         });          $('#todate').datepicker({             showbuttonpanel: true,             changemonth: true,             changeyear: true,             dateformat: "yy-mm-dd",             firstday: 1,             onselect: function (datetext) {                 $('#enddate').datepicker('option', 'mindate', new date(datetext));             }         });      }); }); 

you have changed language en sv fine need include external js support swedish language , can here

swedish js

now add script src js after adding bootstrap-datepicker.js below

<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/locales/bootstrap-datepicker.sv.min.js"></script> 

working demo


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -