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:
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
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>
Comments
Post a Comment