boostrap3 bootstrap-datetimepicker.min.js set up Chinese language

problem

bootstrap3 used bootstrap-datetimepicker trouble setting Chinese language problem

Solution

bootstrap-datetimepicker use when first introduced momentjs moment.js default display in English.
want to show the Chinese by the momentjs download references moment-with-locales.min.js to set the language.
Since the moment-with-locales. min.js file is too large, all options to introduce Chinese language pack github address

clipboard.png

Found in the locale zh-cn.js
clipboard.png

<!--bootstrap 时间控件 -->
<link rel="stylesheet" href="bootstrap-timepicker.min.css"/>

<script src="moment.min.js"></script>
<script src="bootstrap-datetimepicker.min.js"></script>
<script src="zh-cn.js"></script>
<script>
  $('#date-timepicker').datetimepicker({
        locale: moment.locale('zh-cn') //引入中文语言   
        ...
  })
</script>

to sum up

Omitted some key stakeholders bootstrap css, js files, simply record learning problems, please correct me if problems

Guess you like

Origin www.cnblogs.com/baimeishaoxia/p/12207238.html