Skip to content Skip to sidebar Skip to footer

Knockout-kendo.js Grid Ui:datepicker Filter

I am using the Knockout-Kendo.js integration library I am trying to get the datepicker filter working. However, whenever I add filterable: {ui: 'datetimepicker' } to my configura

Solution 1:

I think that may be caused by wrong formatted date string in SubmittedDate. Try to use this instead:

filterable: {
            cell: {
                template: function (args) {
                    args.element.kendoDatePicker({
                        format: "MM dd yyyy, h:mm:ss tt zzz",
                        parseFormats: ["MM dd yyyy, h:mm:ss tt zzz"]
                    });
                }
            }
        }

If you have a time zone in your date string, try to convert all dates in datasource in correct format for kendo (iso 8601):

dateToLocalUTCString = function(date, isUtc) {
    var pad = function(number) {
        var r = String(number);
        if (r.length === 1) {
            r = '0' + r;
        }
        return r;
    }
    returndate.getFullYear()
        + "-" + pad(date.getMonth() + 1)
        + "-" + pad(date.getDate())
        + "T" + pad(date.getHours())
        + ":" + pad(date.getMinutes())
        + ":" + pad(date.getSeconds())
        + "." + String((date.getMilliseconds() / 1000).toFixed(3)).slice(2, 5)
        + (isUtc ? "Z" : "");
};

Post a Comment for "Knockout-kendo.js Grid Ui:datepicker Filter"