I have a date column in my datatable. If I check the checkbox I want only the rows with date less than current date to be shown. I have tried this. Please help me correct the code



CheckBoxList::create(array(
    "name"=>"have_task",
    "data"=>array(
        "مهام معطلة مطلوب تفويضها"=>"نعم"
        
    ),
    "clientEvents"=>array(
        "change"=> "function(params){
            var table = $('#example').DataTable();
              console.log('have_task');

        if(params.value[0]==='نعم'){
               
            var d=new Date();

            month = '' + (d.getMonth() + 1),
            day = '' + d.getDate(),
            year = d.getFullYear();
    
        if (month.length < 2) 
            month = '0' + month;
        if (day.length < 2) 
            day = '0' + day;
    
        createDate=[year, month, day].join('-');
            
        }
        if(table.columns(17)<createDate)
        {
            return true;
        }



                        // $('#mydate').hide();


    }"