bootstrap datepicker显示月份数而不是月份名称

时间:2014-10-07 01:41:32

标签: bootstrap-datepicker

有没有办法在日历网格中显示月份编号而不是月份名称?

因为现在我可以看到2014年1月,2014年2月......等等

有没有办法显示月份编号,如2014年1月2日

由于

1 个答案:

答案 0 :(得分:1)

您可以重新定义这个'月份'调用datepicker init之前的数组:

$.fn.datepicker.dates['en'] = {
    days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
    daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
    daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
    months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
    monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
    today: "Today",
    clear: "Clear"
};
$('#your_datepicker_id').datetimepicker();