0

I use telerik scheduler in html+js. My code is:

$(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" }
            ]
        }
    ]
    });
});

Like you see I've changed culture of scheluder (date and time format, names of days, months etc.) and timezone. All of my tasks are disappear. If I removed first line (kendo.culture("pl-PL")) tasks will be shown.

How can I work with changing culture and timezone in the same time? It's even posiible?

Edit

My sample value returned by controller is:

{"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":""}
1_bug
  • 5,505
  • 4
  • 50
  • 58

1 Answers1

0

Have you Included the file kendo.timezones.min.js ? If not then you have to add (in your header html section)the following line

<script src="http://kendo.cdn.telerik.com/2016.1.112/js/kendo.timezones.min.js"></script>

You can find a working sample here http://dojo.telerik.com/udAyo

  • Yes, I did. Even before changed my file to yours problem still occurred. Btw. In your sample culture is not changed properly - there is still english culture (name of months, days, not 24-hours time etc.) – 1_bug Mar 04 '16 at 13:30
  • need to include kendo.culture.pl-PL.min.js, kendo.messages.pl-PL too: ` – Panagiotis Pnevma Mar 04 '16 at 14:02
  • I already have **kendo.culture.pl-PL.min.js** file. Adding **kendo.messages.pl-PL.min.js** nothing changed. – 1_bug Mar 04 '16 at 14:25
  • Can you provide full code or the scheduler's initialization code? – Panagiotis Pnevma Mar 05 '16 at 18:34
  • I've updated my question. Please pay your attention to returned model - especially for DateTime format (`Start` and `End` field) - it's possible that format is incorrectly and scheduler can't parse it? Btw. If I read from demos.telerik.com url everything work perfectly. – 1_bug Mar 07 '16 at 08:02