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

DatePicker against DateTime data

1 Answer 85 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
mike
Top achievements
Rank 1
mike asked on 24 Jul 2014, 07:43 PM
data field looks like this
DateOfBirth=1969-09-30T00:00:00

and
         schema: {
            model: {
                fields: {
                    DateOfBirth: {
                        type: "date"
                    }
                }
            }

filterable: {
                    ui: function datetimepicker(control) {
                        control.kendoDatePicker({
                            format: "MM-dd-yyyy hh:mm tt",
                            parseFormats: ["MM-dd-yyyy", "MM/dd/yyyy", "HH:mm"]
                        });
                    }
                }


when i filter with kendoDatePicker with an entry of 9/30/1969 i get no results back

i have formatted the display to only show the date part


how can i filter by typing a date of 9/30/1969 and get results back?

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 28 Jul 2014, 02:27 PM
Hi Mike,

Most probably the problem comes from the fact that your data has a time part inside of it, which does not match the entered filter value:

(1969-09-30)(T00:00:00)
  date       time

I would suggest you to either pass the date value without the time part, or you can use the schema.parse configuration option, where you can strip the time part of the date before passing to the Grid:

http://docs.telerik.com/kendo-ui/api/framework/datasource#configuration-schema.parse

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Date/Time Pickers
Asked by
mike
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or