我正在使用提供和解释的Bootstrap Date Range Picker 在这个页面中我使用cdn添加了所有库,我的意思是:
但问题是我需要所有西班牙语,我没有看到一段代码来配置它.我该怎么办?
包括locale
选项并编辑相应的字符串,例如fromLabel
或December
:
$('#datePicker').daterangepicker({
"locale": {
"format": "MM/DD/YYYY",
"separator": " - ",
"applyLabel": "Apply",
"cancelLabel": "Cancel",
"fromLabel": "From",
"toLabel": "To",
"customRangeLabel": "Custom",
"daysOfWeek": [
"Su",
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa"
],
"monthNames": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"firstDay": 1
}
})
这是一个西班牙月份名称的演示 - > http://jsfiddle.net/r21747qc/
您可以使用moment-with-locales.min.js而不是moment.min.js
并在初始化daterangepicker之前设置本地化
moment.locale('es'); $('#datePicker').daterangepicker();