0
我在html + js中使用telerik調度程序。我的代碼是:Telerik調度程序 - 當文化改變時任務消失
$(document).ready(function() {
kendo.culture("pl-PL");
$("#scheduler").kendoScheduler({
date: new Date("2016/3/4"),
startTime: new Date("2016/3/4 07:00"),
views: [
"day",
{ type: "workWeek", selected: true },
"week",
"month"
],
timezone: "Europe/Warsaw",
dataSource: {
batch: true,
transport: {
read: {
url: "../Meetings/Read",
dataType: "jsonp"
},
update: {
url: "http://demos.telerik.com/kendo-ui/service/tasks/update",
dataType: "jsonp"
},
create: {
url: "http://demos.telerik.com/kendo-ui/service/tasks/create",
dataType: "jsonp"
},
destroy: {
url: "http://demos.telerik.com/kendo-ui/service/tasks/destroy",
dataType: "jsonp"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
schema: {
model: {
id: "ID",
fields: {
ID: { from: "MeetingID" ,type: "number" },
title: { from: "Title", defaultValue: "No title", validation: { required: true } },
start: { type: "date", from: "Start" },
end: { type: "date", from: "End" },
description: { from: "Description" },
recurrenceId: { from: "RecurrenceID" },
recurrenceRule: { from: "RecurrenceRule" },
recurrenceException: { from: "RecurrenceException" },
ownerId: { from: "OwnerID", defaultValue: 1 },
isAllDay: { type: "boolean", from: "IsAllDay" }
}
}
},
filter: {
logic: "or",
filters: [
{ field: "ownerId", operator: "eq", value: 1 },
{ field: "ownerId", operator: "eq", value: 2 }
]
}
},
resources: [
{
field: "ownerId",
title: "Owner",
dataSource: [
{ text: "Alex", value: 1, color: "#f8a398" },
{ text: "Bob", value: 2, color: "#51a0ed" },
{ text: "Charlie", value: 3, color: "#56ca85" }
]
}
]
});
});
就像你看到的我已經改變了scheluder(日期和時間格式,天名,月等)和時區的文化。我所有的任務都消失了。如果我刪除第一行(kendo.culture("pl-PL")
),任務將顯示。
如何在同一時間更改文化和時區?這甚至可能嗎?
編輯
我的樣品由控制器返回的值是:
{"MeetingID":1,"Start":"2016-03-01T08:30:00","End":"2016-03-01T07:30:00","Title":"Testowe","Description"
:"ASD","OwnerID":1,"IsAllDay":false,"RecurrenceRule":"","RecurrenceID":1,"RecurrenceException":"","StartTimezone"
:"","EndTimezone":""}
是的,我做到了。甚至在更改我的文件到您的問題之前,仍然發生。順便說一句。在您的樣本文化中沒有改變 - 仍然有英文文化(名稱爲月,日,不是24小時時間等) –
需要包含kendo.culture.pl-PL.min.js,kendo.messages.pl -PL太:'