This is a migrated thread and some comments may be shown as answers.

Programmatically set date

3 Answers 1179 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 14 Mar 2014, 02:15 PM
I have attempted to set the "date" in scheduler using the following:

var startDate = Date.parse(start);
var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.setOptions({ date: startDate });
scheduler.view(scheduler.view().name);

When the scheduler widget displays, the current week, or day is shown. I currently do not have the date: or startTime: fields in my scheduler definition.

$("#scheduler").kendoScheduler({
    // Cannot edit tasks in schedule
    editable: false,
    // Define allowable scheduler views
    views: [
        { type: "day",
            dateHeaderTemplate: kendo.template($("#header-template").html())
        },
        { type: "week",
            dateHeaderTemplate: kendo.template($("#header-template").html()),
            selected: true
        },
        "month"
    ],
    footer: false,
    // Define how the hours are displayed
    majorTimeHeaderTemplate: kendo.template("<strong>#=kendo.toString(date,'HH')#</strong><sup>00</sup>"),
    eventTemplate: $("#event-template").html(),
    // 2 ticks between hours
    minorTickCount: 2,
    resources: [
        {
            field: "segment",
            dataSource: []
        }
    ],
    navigate: scheduler_navigate
});

3 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 14 Mar 2014, 03:00 PM
Hello Randy,

I would suggest you try the scheduler's date method, which sets the current date:
Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Aaron
Top achievements
Rank 1
answered on 09 Dec 2015, 05:51 AM

Georgi,

 That link is useless.  Is there an actual way to set the date to today?  All the examples in your demos use the same date and that is not very useful when it is no longer 2013 :D

0
Georgi Krustev
Telerik team
answered on 09 Dec 2015, 10:49 AM
Hello Aaron,

Please excuse me for the incorrect link. I updated it in my initial message. Nevertheless, here is the link to the date method:
Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Scheduler
Asked by
Randy
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or