Current filter control for a date column only shows a date picker, if the data that's bound to the column also contains the time part then the filters don't work properly. Adding a date time picker would solve the problem.
Hello,
The Kendo UI Grid filterable UI can be customized to use a DateTimePicker with the following option:
https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.filterable.ui
columns: [ {
field: "date",
filterable: {
ui: "datetimepicker" // use Kendo UI DateTimePicker
}
}],
The Kendo UI Datepicker uses JavaScript Date object internally to hold the selected date value. As you probably know, it always uses the local (browser) timezone. We tried to explain that caveat in our docs too:
https://docs.telerik.com/kendo-ui/controls/scheduling/scheduler/timezones#basics
Due to this default behavior, the widget will use the already converted Date value (with the applied local timezone). The widget doesn't manipulate the value timezone, as it does not have sufficient information how to do that.
As an alternative some developers choose to keep the data in the grid and on the server in UTC or utilize DateTimeOffset type. We have another feature request which we are considering to enhance to bind to the DateTimeOffset type which would help with filtering dates with times in different timezones. You can see it and upvote it here:
Also, your feedback on the other item is highly appreciated as we try to gather as much information as possible before we start with the implementation.
Kind Regards,
Alex Hajigeorgieva
Progress Telerik
It would be nice to have a built-in option to allow selecting both date and time. I assume that the filtering problems are due to the data value and the filter value not being truncated to the same depth. For example the 'eq' filter with a date value of 2015-12-29T00:00:00.000Z won't match a data value of 2015-12-29T01:23:45.678Z. However, if the displayed data values are being truncated to the day (e.g. 2015-12-29) there may be an expectation that the matched dates only needs to match up to that precision. This situation could be accommodated by having parameters to indicate if and how date/times produced for filtering (and possibly the data) should be truncated before comparison. I imagine the parameters for this could either be: - date formatting strings, which will be used to convert to string and then back from string to a Date. This is similar a common approach to handling floating point numbers, but would incur some overhead due to conversion to/from a string. - some enumerated value that specifies the smallest time field to keep (e.g. days, hours, minutes, etc.). This could hook into the existing Date API tom convert directly from Date to Date while leaving off some components. However, this may require some additional thought to properly accommodate truncation within different timezones. - a function to manually handle any conversion. While this seems similar to supplying a custom function as the filter operator, it would be fundamentally different because it would change the value stored in the filter rather than the comparison used for filtering. That updated value could then be passed to remote data sources too.
This is a total pain when using a remote datasource. I totally can't believe that they haven't fixed this issue yet. This is unacceptable!
Definately need some way to filter on the time portion. I need to specify my filter as a date and time as that's what my column is showing. I don't want to (can't) split the values into 2 separate columns for filtering on. You should be able to specify the type of column as 'datetime' (or leave as 'date' for where filtering on the time is not necessary) and have a date and time picker available for filtering.
No it won't work if we add a datetimepicker.. give other suggestion for this issue