Date Bootsrtap-datatimepicker and Bootstrap-datepicker controls support Chinese

Source: Internet
Author: User

Reference Bootsrtap-datatimepicker and Bootstrap-datepicker control, found that the official control does not support Chinese

1,bootstrap-datepicker-"Solution:

Download from GitHub below this third party has supported localization, Https://github.com/eternicode/bootstrap-datepicker,

Only 2 files to download

Bootstrap-datepicker.js

Bootstrap-datepicker.zh-cn.js can be.

Call:

<script src= "/assets/js/date-time/bootstrap-datepicker.js" ></script>

<script src= "/assets/js/date-time/locales/bootstrap-datepicker.zh-cn.js" ></script>

$ ('. Date-picker '). DatePicker ({

Language: ' ZH-CN ',
Autoclose:true,
Todayhighlight:true
});

Source: http://blchen.com/make-bootstrap-datepicker-support-chinese/

2,bootstrap-datetimepicker-"Solution:

The Bootstrap-datetimepicker localization display relies on the moment plugin. This means that the moment plugin provides multi-lingual content support, while Bootstrap-datetimepicker has no language content.

To do this, if you need to support the display of Simplified Chinese, you will need to load the Chinese resource file.

In moment's official website, download moment+locales.js, find the ' ZH-CN ' section, save as JS file, between Moment.js and bootstrap-datetimepicker.js loading can!

Github:https://github.com/moment/moment

<script src="assets/thirdparty/bootstrap-datetimepicker/js/moment.js"></script>

<script src= "assets/thirdparty/bootstrap-datetimepicker/js/moment_zh-CN.js" ></script> <script src= "assets/thirdparty/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js" ></script>Effect:

Source: http://www.myext.cn/c/a_6181.html

Date Bootsrtap-datatimepicker and Bootstrap-datepicker controls support Chinese

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.