<ScheduleEventSettings DataSource="@DataSource">
<Template>
<div>Subject: @((context as dynamic).Subject)</div>
<div>StartTime: @((context as dynamic).StartTime)</div>
<div>EndTime: @((context as dynamic).EndTime)</div>
</Template>
</ScheduleEventSettings> |
public void onEventRendered(EventRenderedArgs args)
{
BlogSite bsObj = JsonConvert.DeserializeObject<BlogSite>(JsonConvert.SerializeObject(args.Data));
DateTime localDate = bsObj.StartTime.ToLocalTime();
var hours = localDate.TimeOfDay.Hours;
if (hours < 12)
{
(args.Element).AddClass(this.cus1_class);
}
else if (hours >= 12 && hours < 18)
{
(args.Element).AddClass(this.cus2_class);
}
else if (hours >= 18)
{
(args.Element).AddClass(this.cus3_class);
}
} |