This is a migrated thread and some comments may be shown as answers.

Date Filter Issue

1 Answer 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amr Saafan
Top achievements
Rank 2
Amr Saafan asked on 13 Jun 2020, 12:29 PM

 

Hello,

 

I am using this code to filter a Date Column in Kendo Ui Grid

field: 'myDatetimeColumn', title: 'Date', width: "12%"
                        , filterable: {
                            ui: function (element) {
                                element.kendoDateTimePicker({
                                    format: "dd-MMM-yyyy HH:mm",
                                    timeFormat: "HH:mm"
                                });
                            }
                        }

 

But it is not filtering correctly .

Please find attached screen shots for more information.

 

Also https://dojo.telerik.com/eWAKAmoW/2  you can reproduce the issue there.

 

Regards,

Amr Saafan

https://www.nilebits.com/

1 Answer, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 16 Jun 2020, 01:49 PM

Hello Amr Saafan,

Thank you for sharing a runnable sample, which I can analyze and advise you further.

I noticed that Event 6 takes the current date and time and you should keep in mind that this is an exact time and is very accurate (the time is in milliseconds). Comparing it exactly to another value can be hard. This is why I would advise you to test with the other entries that are with the same format, as the expected one "yyyy/MM/dd HH:ss".

I did some changes to the initial code and you can find the link here. The function that you have for filtering should be defined outside the kendoGrid, so it can be use to filter the exact column that you need. Please check the filtering menu customization demo for more details and a larger scale working sample.

Based on the screenshots that you shared, I see that the format in the filtering function does not match the actual data in your grid. It seems that the correct format that you should use is "ddd dd-MMM-yyyy HH:ss". Please try to match the data in the grid to the filtering format.

I hope the above details will be helpful to you. Please do not hesitate to contact us again, if you need further assistance or you have follow up questions.

Thank you for your cooperation in the discussion.

Regards,
Plamen Mitrev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Amr Saafan
Top achievements
Rank 2
Answers by
Plamen Mitrev
Telerik team
Share this question
or