$('#date').daterangepicker({
    locale: { cancelLabel: 'Sil', customRangeLabel: "Özel seçim" },
    buttonClasses: ' btn',
    applyClass: 'btn-primary',
    cancelClass: 'btn-secondary',
    ranges: {
        'Bugün': [moment(), moment()],
        'Dün': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
        'Son 7 Gün': [moment().subtract(6, 'days'), moment()],
        'Son 30 Gün': [moment().subtract(29, 'days'), moment()],
        'Bu Ay': [moment().startOf('month'), moment().endOf('month')],
        'Geçen Ay': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
    }
}, function (start, end, label) {
    document.getElementById('date_start').value = start.format('YYYY-MM-DD');
    document.getElementById('date_end').value = end.format('YYYY-MM-DD');
});

$('#date').on('cancel.daterangepicker', function (ev, picker) {
    document.getElementById('date_start').value = "";
    document.getElementById('date_end').value = "";
});

document.getElementById('cf-select-all').addEventListener('click', selectAllRows);
function selectAllRows(){
    var checkBox = document.getElementById("cf-select-all");
    var rows = $('.check-column input[type="checkbox"]');

    if (checkBox.checked == true){
        rows.prop("checked", true);
    } else {
        rows.prop("checked", false);
    }
}