FIlter DateTime column only by date

1 Answer 4593 Views
Grid
Szymon
Top achievements
Rank 1
Szymon asked on 11 Aug 2015, 01:50 PM

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?

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 13 Aug 2015, 01:31 PM
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!
 
Petar
Top achievements
Rank 1
commented on 22 Mar 2018, 10:13 AM

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

Pavlina
Telerik team
commented on 26 Mar 2018, 11:19 AM

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.
Petar
Top achievements
Rank 1
commented on 26 Mar 2018, 11:54 AM

This method is ok, but I want also to have CRUD operations over the datetime filed and in this approach that is not possible.
Boyan Dimitrov
Telerik team
commented on 05 Apr 2018, 11:33 AM

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.
Petar
Top achievements
Rank 1
commented on 11 Apr 2018, 07:30 AM

Thank you a lot Boyan this solves my problem!

Regards,

Petar

Tags
Grid
Asked by
Szymon
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or