FIlter DateTime column only by date

7 posts, 0 answers
  1. Krzysztof
    Krzysztof avatar
    3 posts
    Member since:
    Dec 2013

    Posted 11 Aug 2015 Link to this post

    Hello 

     

    ​I have a grid with remote json kendo datasource. In this model I have dateTime type field. I want to filter all records, which is equal to date chosen in column filter and ignore the time part. I'll give an example:

     

    I have records: 08/05/15 7:23:00, 08/05/15 ​16:46:00, 10/05/15 20:31:00

    I write in filter: 08/05/15

    I want to get rec​ords: 08/05/15 7:23:00, 08/05/15 ​16:46:00.

     

    Generally speaking, this thread is similar to http://www.telerik.com/forums/grid-filters-with-date-and-time#zyQCkkICqE6c-MSzxNvGcg. There is the project, which works well, but only ​in Telerik version 2012.1. Could you provide an example project with this feature in Telerik version 2015.2.805?

  2. Pavlina
    Admin
    Pavlina avatar
    6182 posts

    Posted 13 Aug 2015 Link to this post

    Hello,

    With the latest version you just need to specify the filterable UI as shown in the article below:

    Check the first example:
    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.filterable.ui

    Regards,
    Pavlina
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Petar
    Petar avatar
    5 posts
    Member since:
    Oct 2017

    Posted 22 Mar in reply to Pavlina Link to this post

    Hello,

    I have the same issue and I can't solve it. I tried a lot of things but still can't achieve what I want.

    So here is a dojo https://dojo.telerik.com/oXUCeFEW 

    The thing that I want is if I select 22/03/2018 on the filter to show all values on date 22/03/2018 regardless of the time.

    Thank you for your help in advance!

    Greetings,

    Petar

  4. Pavlina
    Admin
    Pavlina avatar
    6182 posts

    Posted 26 Mar Link to this post

    Hello Petar,

    By default the filter will use the date and time to apply the relevant operation. If you would like the time part to be ignored when filtering I can suggest using one of the approaches described in the following article.

    https://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/filtering/filter-by-date

    Give the suggestions a try and let me know how they work for you.

    Regards,
    Pavlina
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Petar
    Petar avatar
    5 posts
    Member since:
    Oct 2017

    Posted 26 Mar in reply to Pavlina Link to this post

    This method is ok, but I want also to have CRUD operations over the datetime filed and in this approach that is not possible.
  6. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2008 posts

    Posted 05 Apr Link to this post

    Hello,

    The following https://dojo.telerik.com/iFeVExud example will transform the filter expression to return all records for specific date (ignoring the time) without modifying the actual data in the DataSource. This will give you the advantage to filter dates without taking the time value into account and perform your CRUD operations because after all you are working with the real data. 

    Regards,
    Boyan Dimitrov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Petar
    Petar avatar
    5 posts
    Member since:
    Oct 2017

    Posted 11 Apr in reply to Boyan Dimitrov Link to this post

    Thank you a lot Boyan this solves my problem!

    Regards,

    Petar

Back to Top