【发布时间】:2014-05-19 11:54:23
【问题描述】:
我在 Kendo Grid 中发送格式化的日期选择器值 (5/17/2014)。在网格中,它显示正确的格式,但在发送后,在服务器 (PHP) 上它被发布为 Sat May 17 2014 00:00:00 GMT+0530 (IST)。我如何从客户端自己克服这个问题。
model: {
id: "id",
fields: {
id: {
editable: false /*type: "number"*/
},
schedule_date: {
type:"date",
format:"M/d/yyyy"
},
}
columns: [ {field: "schedule_date", type:"date", "format": "M/d/yyyy",parseFormats: ["M/d/yyyy"],
title: "Schedule Date",editable: true,width:"200px",
editor: function(container, options) {
var input = $("<input/>");
input.attr("name", options.field);
input.appendTo(container);
input.kendoDatePicker({
"format": "M/d/yyyy",
parseFormats: ["M/d/yyyy"],
});
}}
]
【问题讨论】:
-
你为什么不把它格式化为 dd/MMM/yyyy。永远不要混淆与语言/文化无关的东西。
标签: kendo-ui kendo-grid