Date filter doesn't ignore the time

3 posts, 0 answers
  1. Dana
    Dana avatar
    1 posts
    Member since:
    Mar 2013

    Posted 28 Mar 2013 Link to this post

    When filtering on a date column in the grid, the dates are filtered by time as well as by date. This creates a problem when trying to filter with "equals to". 
    I can easily remove the time from the date object in the grid and this fixes the filtering.
    However, I might need to display the time in the date object in the grid. 

    How can I have the dates filtered while ignoring the time, or alternatively display the date with the time, but filter with a date object without the time?

  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 29 Mar 2013 Link to this post


    I think it is not possible or very hard to achieve this thing in in-built filter functionality.

    Please try with Custom Filter.

    Jayesh Goyani
  3. Alexander Valchev
    Alexander Valchev avatar
    2887 posts

    Posted 01 Apr 2013 Link to this post

    Hello Dana,

    As @Jayesh correctly said, such feature is not supported out of the box. By default DataSource filters the underlying data, if the value of your date field contains time information, it will not be ignored.

    The DataSource provides opportunity for defining a custom filter operator:
    dataSource.filter({ field: "orderId", operator: function(input) {
        //your logic
    }, value: 10428 });

    It would be easier to use this approach with external filter menu. The build-in one does not provide opportunity for customizing the operators like shown above.

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top