Skip to content

Advanced Search Date Comparison

The following code snippet shows how to enable date comparison in advanced search using set_col_property method. The javascript adds datepicker. 

PHP
$dg -> set_col_property("orderDate",
                        array("formatter"=>"date",
                            "sorttype"=>"date",
                            "searchoptions"=>
                                array("dataInit"=>"###datePick###")));


JAVASCRIPT
<script>
    datePick = function(elem)
    {
        $(elem).datepicker({
            dateFormat: 'dd-M-yy',
            autoSize: true,
            changeYear: true,
            changeMonth: true,
            showButtonPanel: true,
            showWeek: true
        });
    }
</script>


Feedback and Knowledge Base