DatePicker against DateTime data

2 posts, 0 answers
  1. mike
    mike avatar
    4 posts
    Member since:
    Jul 2014

    Posted 24 Jul 2014 Link to this post

    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?
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 28 Jul 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top