Adding a TimePicker to Kendo UI Grid Date Columns

Falafel Software Bloggers
Falafel Software
Published in
2 min readSep 22, 2014

I recently needed to add a TimePicker to a Date column in a Kendo grid, and since the default filter is just a calendar, I was preparing to do my own custom filter UI, when I came across this demo code on the Telerik site. Wait, can I just set the filter UI to a built-in editor? Why yes, yes I can!

Now, if you want to do ‘real’ custom filters, check out Josh’s excellent example over here. But if you just want to change to a different editor, you’re in luck. The code could not be simpler. When declaring your grid column, just set the filterable ui property to the built-in editor of your choice.

field: "TimeData",
title: "Date/Time with Picker",
format: "{0: MM/dd/yyyy hh:mm tt}",
filterable: {
ui: "datetimepicker"
}

Now, the default editor (before our change) for a Date column is a calendar, like this:

2014-09-21 23_27_36-Setting Filter Editors in Kendo Grid - JSFiddle

But with our new setup, we have the additional option of setting a time:

2014-09-21 23_28_17-Setting Filter Editors in Kendo Grid - JSFiddle

And, most importantly, the filtering works correctly with the date/time property in our datasource. You can try out the full sample here:

And now I’m done! Thanks Kendo, that was easy!

--

--