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

Scheduler DayTimeFormat

2 Answers 68 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Davide Vernole
Top achievements
Rank 2
Davide Vernole asked on 20 Nov 2017, 09:45 AM
I'm having some troubles trying to display events in the Scheduler, maybe casued by DateTime format.

My scheduler configuration is the following:

@(Html.Kendo().Scheduler<BookingSchedulerDto>()
    .Name(“Scheduler")
    .Date(DateTime.Now)
    .StartTime(Model.Start)
    .EndTime(Model.End)
    .Editable(m => m.TemplateId("editor"))
    .Views(views =>
    {
        views.DayView(view => view.Selected(true));
        views.WeekView();
        views.MonthView();
        views.AgendaView();
    })
    .Timezone("Etc/UTC")
    .DataSource(d => d
        .Events(e =>
        {
            e.Error("onError");
        })
        .Model(m =>
        {
            m.Id(f => f.Id);
            m.Field(f => f.Start);
            m.Field(f => f.End);
            m.Field(f => f.Title).DefaultValue("Nessun titolo");
            m.Field(f => f.IsAllDay).DefaultValue(false);
            m.Field(f => f.Name);
        })
        .Create("Update", "Booking")
        .Read("Read", "Booking")
        .Update("Update", "Booking")
        .Destroy("Delete", "Booking")
    )
)

where the Model.Start and Model.End are DateTime types. 
The BookingSchedulerDto entity properties Start and End are also DateTime objects. An example of result of read method is
[
  {
   …,
    "StartTimezone": "Etc/UTC",
    "EndTimezone": "Etc/UTC",
    "RecurrenceRule": null,
    "Start": "2017-11-07T20:16:54.073+01:00",
    "End": "2017-11-07T23:16:54.073+01:00",
    "Id": 4,
   …
  },
  {
      …
  }
]

The problem here is that events are not rendered in the scheduler as expected. What am I doing wrong? Is the result date format correct? Any other causes?

2 Answers, 1 is accepted

Sort by
0
Accepted
Neli
Telerik team
answered on 21 Nov 2017, 03:47 PM
Hi Davide,

Enclosed you could find a sample project, where the events are rendered correctly.
Could you please modify it in order to reproduce the issue.
This way we can inspect it locally and assist you further.

Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Davide Vernole
Top achievements
Rank 2
answered on 21 Nov 2017, 05:35 PM

Hi Neil,
thanks for the reply and for the example attached.

Comparing your code with ours we identified where the error was. Our reading method returned a list of BookingSchedulerDto while your component expected a DataSourceObject containing the objects of that type.

Issue resolved ;-) Thanks

Tags
Scheduler
Asked by
Davide Vernole
Top achievements
Rank 2
Answers by
Neli
Telerik team
Davide Vernole
Top achievements
Rank 2
Share this question
or