2018年12月14日金曜日

Telerik ASP.NET MVC Schedulerの日付設定

Kendo().Schedulerで当日日付の指定

@(Html.Kendo().Scheduler<AskaGroup.Models.EventViewModel>()
    .Name("scheduler")
    .Date(new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day))
    .StartTime(new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 9, 00, 00))

    .Height(600)
    .Views(views => {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
        views.AgendaView();
    })
    .Timezone("Etc/UTC")
    .DataSource(d => d
        .Model(m => {
            m.Id(f => f.EventID);
            m.Field(f => f.OwnerID).DefaultValue('1');
            //Set the recurrence ID field from the model:
            m.RecurrenceId(f => f.RecurrenceID);
        })
        .Read("Event_Read", "SDL")
        .Create("Event_Create", "SDL")
        .Destroy("Event_Destroy", "SDL")
        .Update("Event_Update", "SDL")
    )
)

0 件のコメント:

コメントを投稿