Skip to content

Advanced Search: Enable greater than/less then for date fields

The search comparison only targets string. The date comparison is not enabled by default. Here's how to enable date comparison. 

<?php
$dg -> set_col_property("COLUMN_NAME",
                        array("formatter"=>"date",
                            "sorttype"=>"date",
                            "searchoptions"=>
                                array("dataInit"=>"###datePick###")))->enable_advanced_search(true);
?>

Javascript to enable datepicker control

<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