|
@@ -1047,82 +1047,7 @@ function init_IonRangeSlider() {
|
|
|
}))
|
|
|
}
|
|
|
function init_daterangepicker() {
|
|
|
-
|
|
|
- // if (typeof ($.fn.daterangepicker) === 'undefined') {
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // console.log('init_daterangepicker');
|
|
|
- //
|
|
|
- // var cb = function (start, end, label) {
|
|
|
- // console.log(start.toISOString(), end.toISOString(), label);
|
|
|
- // $('#reportrange span').html(start.format('YYYY-MM-DD') + ' - ' + end.format('YYYY-MM-DD'));
|
|
|
- // };
|
|
|
- // var optionSet1 = {
|
|
|
- // //startDate: moment().subtract(29, 'days'),
|
|
|
- // startDate: moment(),
|
|
|
- // endDate: moment(),
|
|
|
- // minDate: '2012-01-01',
|
|
|
- // maxDate: nowString(),
|
|
|
- // dateLimit: {
|
|
|
- // days: 1200
|
|
|
- // },
|
|
|
- // showDropdowns: true,
|
|
|
- // showWeekNumbers: true,
|
|
|
- // timePicker: false,
|
|
|
- // timePickerIncrement: 1,
|
|
|
- // timePicker12Hour: true,
|
|
|
- // ranges: {
|
|
|
- // '今天': [moment(), moment()],
|
|
|
- // '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
|
|
- // '最近7天': [moment().subtract(6, 'days'), moment()],
|
|
|
- // '最近30天': [moment().subtract(29, 'days'), moment()],
|
|
|
- // '当月': [moment().startOf('month'), moment().endOf('month')],
|
|
|
- // '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
|
|
- // },
|
|
|
- // opens: 'left',
|
|
|
- // buttonClasses: ['btn btn-default'],
|
|
|
- // applyClass: 'btn-small btn-primary',
|
|
|
- // cancelClass: 'btn-small',
|
|
|
- // format: 'YYYY-MM-DD',
|
|
|
- // separator: ' to ',
|
|
|
- // locale: {
|
|
|
- // applyLabel: '确定',
|
|
|
- // cancelLabel: '取消',
|
|
|
- // fromLabel: 'From',
|
|
|
- // toLabel: 'To',
|
|
|
- // customRangeLabel: '自定义',
|
|
|
- // daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
|
|
|
- // monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
|
|
- // firstDay: 1
|
|
|
- // }
|
|
|
- // };
|
|
|
- //
|
|
|
- // //$('#reportrange span').html(moment().subtract(29, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
|
|
|
- // $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
|
|
|
- // $('#reportrange').daterangepicker(optionSet1, cb);
|
|
|
- // $('#reportrange').on('show.daterangepicker', function () {
|
|
|
- // console.log("show event fired");
|
|
|
- // });
|
|
|
- // $('#reportrange').on('hide.daterangepicker', function () {
|
|
|
- // console.log("hide event fired");
|
|
|
- // });
|
|
|
- // $('#reportrange').on('apply.daterangepicker', function (ev, picker) {
|
|
|
- // console.log("apply event fired, start/end dates are " + picker.startDate.format('YYYY-MM-DD') + " to " + picker.endDate.format('YYYY-MM-DD'));
|
|
|
- // });
|
|
|
- // $('#reportrange').on('cancel.daterangepicker', function (ev, picker) {
|
|
|
- // console.log("cancel event fired");
|
|
|
- // });
|
|
|
- // $('#options1').click(function () {
|
|
|
- // $('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);
|
|
|
- // });
|
|
|
- // $('#options2').click(function () {
|
|
|
- // $('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);
|
|
|
- // });
|
|
|
- // $('#destroy').click(function () {
|
|
|
- // $('#reportrange').data('daterangepicker').remove();
|
|
|
- // });
|
|
|
-
|
|
|
- initDaterangepickerWithId('reportrange');
|
|
|
+ initDaterangepickerWithId('reportrange',"left");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1130,7 +1055,7 @@ function init_daterangepicker() {
|
|
|
* 根据id构造日期选择器
|
|
|
* @param id
|
|
|
*/
|
|
|
-function initDaterangepickerWithId(id) {
|
|
|
+function initDaterangepickerWithId(id,opens) {
|
|
|
|
|
|
if (typeof ($.fn.daterangepicker) === 'undefined') {
|
|
|
return;
|
|
@@ -1163,7 +1088,7 @@ function initDaterangepickerWithId(id) {
|
|
|
'当月': [moment().startOf('month'), moment().endOf('month')],
|
|
|
'上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
|
|
},
|
|
|
- opens: 'right',
|
|
|
+ opens: opens,
|
|
|
buttonClasses: ['btn btn-default'],
|
|
|
applyClass: 'btn-small btn-primary',
|
|
|
cancelClass: 'btn-small',
|