Declined
Last Updated: 28 Mar 2023 11:01 by ADMIN
Svitlana
Created on: 21 Mar 2023 11:20
Category: Kendo UI for Angular
Type: Bug Report
0
Filter operator 'equalTo' for grid column with format "M/d/yyyy h:mm a" doesn't work correctly. Or with any date time format

Hi,

Filter operator 'equalTo' doesn't work properly with columns that has DateTime format. I set 'format' property on column, so filter will have the same format, but after providing exact same day and time the result is "no records ".

Here is a reproduction in Stackblitz based on one of the examples from https://www.telerik.com/kendo-angular-ui/components/grid/filtering/filter-menu/.

https://stackblitz.com/edit/angular-tq5ncp?file=src%2Fapp%2Fapp.component.ts%3AL31,src%2Fapp%2Fproducts.ts


1 comment
ADMIN
Georgi
Posted on: 28 Mar 2023 11:01

Hi Svitlana,

Thank you very much for the details provided. 

From what I understand from your question, you are experiencing issues when setting the filter operator to "Is equal to" and trying to filter the column with records of type Date. Please, correct me if I misunderstood you.

Having thoroughly examined the sample data that the Grid component uses in the example, I noticed that some of the records have their FirstOrderedOn attribute set to the millisecond level.

On the other hand, the DatePicker that the DateFilterMenuComponent utilizes does not support setting of time and when typing the hours and minutes in the component, the seconds and milliseconds are set to 0. For this reason, when trying to filter these records that have their milliseconds set in the original data, the filtering functionality could not match these records and the Grid displays the "No records available." message. In order to be able to filter these records, the developer needs to set the seconds and milliseconds to 0 in the original data.  

For your convenience, I am sending you a StackBlitz demo that has this behavior resolved: 

https://stackblitz.com/edit/angular-tq5ncp-z5hpfd?file=src%2Fapp%2Fapp.component.ts

In case the implementation requires the users to be able to set date and time in the filter, I would suggest utilizing the DateTimePicker component to create a custom menu filter

I hope this answers your question. Let me know if I could further assist you with this case.  

Regards,
Georgi
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.