Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Knockout-Kendo.js网格UI:datepicker过滤器_Javascript_Date_Kendo Grid_Knockout Kendo_Kendo Ui Grid - Fatal编程技术网

Javascript Knockout-Kendo.js网格UI:datepicker过滤器

Javascript Knockout-Kendo.js网格UI:datepicker过滤器,javascript,date,kendo-grid,knockout-kendo,kendo-ui-grid,Javascript,Date,Kendo Grid,Knockout Kendo,Kendo Ui Grid,我正在使用集成库 我正在尝试让datepicker过滤器工作。但是,每当我向配置中添加filterable:{ui:“datetimepicker”}时,页面上不会显示任何内容,也不会出现脚本错误 我的kendoGrid配置看起来像(这里在SubmittedDate上具有filterable属性) 我认为这可能是由于提交数据中的日期字符串格式错误造成的。 请尝试使用此选项: filterable: { cell: { template: f

我正在使用集成库 我正在尝试让datepicker过滤器工作。但是,每当我向配置中添加filterable:{ui:“datetimepicker”}时,页面上不会显示任何内容,也不会出现脚本错误

我的kendoGrid配置看起来像(这里在SubmittedDate上具有filterable属性)


我认为这可能是由于
提交数据中的日期字符串格式错误造成的。
请尝试使用此选项:

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"]
                    });
                }
            }
        }
如果日期字符串中有时区,请尝试将
datasource
中的所有日期转换为
kendo
()的正确格式:

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"]
                    });
                }
            }
        }
dateToLocalUTCString = function (date, isUtc) {
    var pad = function (number) {
        var r = String(number);
        if (r.length === 1) {
            r = '0' + r;
        }
        return r;
    }
    return date.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" : "");
};