时间插件

链接:http://www.htmleaf.com/jQuery/Calendar-Date-Time-picker/201806095166.html
http://www.htmleaf.com/jQuery/Calendar-Date-Time-picker/
http://www.htmleaf.com/jQuery/Calendar-Date-Time-picker/201712164883.html



时间范围选择插件:http://www.htmleaf.com/jQuery/Calendar-Date-Time-picker/201712164883.html


配置:
 <script type="text/javascript">
     $(document).ready(function() {
        updateConfig();
     });
     //时间插件配置
   function updateConfig() {
         var options = {};
         options.locale = {
              direction: $('#rtl').is(':checked') ? 'rtl' : 'ltr',
              format: 'MM/DD/YYYY HH:mm',
              separator: ' - ',
              applyLabel: '确定',
              cancelLabel: '取消',
              fromLabel: 'From',
              toLabel: 'To',
              customRangeLabel: 'Custom',
              daysOfWeek: ['日', '一', '二', '三', '四', '五','六'],
              monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
              firstDay: 1
            };
         options.timePicker = true;
         options.timePicker24Hour = true;

    //    options.singleDatePicker = true; 设置单个插件而不是范围选择
          $('#reservation-time').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); });
     }
</script>


原文地址:https://www.cnblogs.com/lajiao/p/9453525.html