Change language for bootstrap DateTimePicker

前端 未结 11 1657
长发绾君心
长发绾君心 2020-12-03 04:15

I use bootstrap-datetimepicker.js Copyright 2012 by Stefan Petre

http://www.malot.fr/bootstrap-datetimepicker/index.php

I import the js and anot

11条回答
  •  难免孤独
    2020-12-03 05:15

    This is for your reference only:

    https://github.com/rajit/bootstrap3-datepicker/tree/master/locales/zh-CN

    https://github.com/smalot/bootstrap-datetimepicker

    https://bootstrap-datepicker.readthedocs.io/en/v1.4.1/i18n.html

    The case is as follows:

     
    $.fn.datepicker.dates['zh-CN'] = { days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"], daysShort:["周日","周一","周二","周三","周四","周五","周六"], daysMin:["日","一","二","三","四","五","六"], months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"], monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"], today:"今日", clear:"清除" }; $('#event_period').datepicker({ inputs: $('input.date'), todayBtn: "linked", clearBtn: true, format: "yyyy年mm月", titleFormat: "yyyy年mm月", language: 'zh-CN', weekStart:1 // Available or not });

提交回复
热议问题