Twitter bootstrap 引导数据采集器可以';t显示在瑞典语上
我用的是bootstrap的这个日期选择器 但是我希望我的月份/日期在瑞典,所以我进入了Javascript,我确实更改了以下行:Twitter bootstrap 引导数据采集器可以';t显示在瑞典语上,twitter-bootstrap,datepicker,Twitter Bootstrap,Datepicker,我用的是bootstrap的这个日期选择器 但是我希望我的月份/日期在瑞典,所以我进入了Javascript,我确实更改了以下行:语言:“en”,太语言:“sv”, 但我的日期选择器看起来像这样: 日期选择器设置: var defaults = $.fn.datepicker.defaults = { autoclose: true, beforeShowDay: $.noop, beforeShowMonth: $.noop, calendarWeek
语言:“en”,
太语言:“sv”,
但我的日期选择器看起来像这样:
日期选择器设置:
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'
};
我视图中的我的日期选择器:
$(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));
}
});
});
});
您已将
language
从en
更改为sv
很好,但您还需要包含外部js
以支持瑞典语,您可以在此处获得它
现在,在添加bootstrap datepicker.js
之后,只需将script src
添加到js
,如下所示
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/locales/bootstrap-datepicker.sv.min.js"></script>
发布一些代码,以便我们能够确定问题出在哪里?@GuruprasadRao抱歉,更新。瑞典语是SE,我认为不是SV。我想在这里你可以找到语言文件,也可以随时查看。。快乐编码…)