Implementation code of BootStrap Datetimepicker Chinese

  • 2021-07-18 07:07:49
  • OfStack

Page reference:


$('input[name=date-range]').daterangepicker({
      'applyClass' : 'btn-sm btn-success',
      'cancelClass' : 'btn-sm btn-default',
      locale: Config.daterangepicker_locale.zh_CN
});

Sinicization of daterangepicker


/**
   * daterangepicker locale
   */
  daterangepicker_locale: {
    zh_CN: {
      applyLabel: ' Determine ',
      cancelLabel: ' Cancel ',
      daysOfWeek: [" Day ","1","2","3","4","5","6"],
      monthNames: ["1 Month ","2 Month ","3 Month ","4 Month ","5 Month ","6 Month ","7 Month ","8 Month ","9 Month ","10 Month ","101 Month ","102 Month "]
    }
  }

Sinicization of datetimepicker


/**
   * daterangepicker locale
   */
  daterangepicker_locale: {
    zh_CN: {
      days: [" Sunday ", " Week 1", " Week 2", " Week 3", " Week 4", " Week 5", " Week 6", " Sunday "],
      daysShort: [" Sunday ", " Week 1", " Week 2", " Week 3", " Week 4", " Week 5", " Week 6", " Sunday "],
      daysMin: [" Day ", "1", "2", "3", "4", "5", "6", " Day "],
      months: ["1 Month ", "2 Month ", "3 Month ", "4 Month ", "5 Month ", "6 Month ", "7 Month ", "8 Month ", "9 Month ", "10 Month ", "101 Month ", "102 Month "],
      monthsShort: ["1 Month ", "2 Month ", "3 Month ", "4 Month ", "5 Month ", "6 Month ", "7 Month ", "8 Month ", "9 Month ", "10 Month ", "101 Month ", "102 Month "],
      today: " Today ",
      suffix: [],
      meridiem: [" Morning ", " Afternoon "]
    }
  }

Related articles: