bei 发表于 2017-12-30 18:06:11

daterangepicker+ bootstrap +php +ajax +datatable双日历的使用

/*****时间插件************************************************************************************************/  var start = moment().subtract(29, 'days');
  var end = moment();
  function cb(start, end) {
  $('#reportrange span').html(start.format('YYYY-MMMM-D') + ' - ' + end.format('YYYY-MMMM-D'));
  }
  $('#reportrange').daterangepicker({
  //minDate: '01/01/2012',                //最小时间
  //maxDate : moment(),                     //最大时间
  //dateLimit : { days : 30 },             //起止时间的最大间隔
  showDropdowns : true,
  // timePicker : true,                     //是否显示小时和分钟
  "linkedCalendars": false,
  "showCustomRangeLabel": false,
  "alwaysShowCalendars": true,
  "opens": "right",                        //日期选择框的弹出位置
  
                startDate: start,
  endDate: end,
  ranges: {
  //'最近1小时': ,
  '今天': ,
  '昨天': ,
  '最近7天': ,
  '最近30天': ,
  '本月': ,
  '上个月':
  },
  locale : {
  applyLabel : '确定',
  cancelLabel : '取消',
  fromLabel : '起始时间',
  toLabel : '结束时间',
  customRangeLabel : '自定义',
  daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
  monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
  '七月', '八月', '九月', '十月', '十一月', '十二月' ],
  firstDay : 1
  },
  buttonClasses : [ 'btn btn-default' ],
  applyClass : 'btn-small btn-primary blue',
  cancelClass : 'btn-small',
  }, cb);
  cb(start, end);
  //时间复位按钮
  $("#reset").click(function () {
  $('#reportrange').val(' ');
  });
  /*****时间插件************************************************************************************************/
页: [1]
查看完整版本: daterangepicker+ bootstrap +php +ajax +datatable双日历的使用