Hello!
I used to have a working custom implementation of showing appointment data in my scheduler. I have a custom field in my appointment called "Status".
After I updated to Angular 9.1 and updated the Schduler also, the appointment data does not show up in the scheduler as before. I noticed in the documentation that now #cellTemplate should be used instead of #eventSettingsTemplate. I changed it, but still it does not work. Has the data-object changed somehow? It does not seem to have the StartTime, EndTime and other properties anymore...
Here are code examples of what I had working:
BEFORE WITH eventSettingsTemplate:
<ejs-schedule #scheduleObj width='100%' height='550px' [selectedDate]="selectedDate" [eventSettings]="eventSettings" [showQuickInfo]="showQuickInfo"
[readonly]="isReadOnly" (eventClick)="onEventClick($event)"
locale="fi" timezone="Europe/Helsinki">
<e-views>
<e-view option='Month'></e-view>
</e-views>
<ng-template #eventSettingsTemplate let-data>
<div class="template-wrap">
{{getTimeString(data.data.startTime)}}- {{getTimeString(data.data.endTime)}}
</div>
</ng-template>
</ejs-schedule>
IN THE .ts file:
public eventSettings: EventSettingsModel = {
fields: {
id: 'id',
startTime: { name: 'startTime', title: 'Alkaa' },
endTime: { name: 'endTime', title: 'Loppuu' },
subject: { name: 'subject', title: 'Jotain' }
}
};
private instance: Internationalization = new Internationalization();
getTimeString(value: Date): string {
this.instance.culture = "fi-FI";
return this.instance.formatDate(value, { type: 'time', format: 'HH.mm' });
}
When getting the appointments on the server:
var dtoEvents = new List<DTO.CalendarEvent>();
foreach (var calendarEvent in events)
{
var e = new DTO.CalendarEvent() { Id = calendarEvent.Id,
StartTime = calendarEvent.StartTime,
EndTime = calendarEvent.EndTime,
Status = DTO.CalendarEventStatus.Free.ToString(),
Subject = DTO.CalendarEventStatus.Free.ToString()
};
dtoEvents.Add(e);
}
return Ok(dtoEvents);
What could be wrong in the above? The data object only seems to be a date... How do I access the start- and end times of the data object?
Thank you,
Anna