Skip to content

Commit 031f38c

Browse files
authored
docs(scheduler): Update OnCellRender docs (#1191)
1 parent 809b138 commit 031f38c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

components/scheduler/events.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -951,19 +951,20 @@ The handler receives an argument of type `SchedulerCellRenderEventArgs` which ex
951951
| Field | Type | Description |
952952
| --- | --- | --- |
953953
| `Class` | `string` | The CSS class that will be applied to the cell. |
954-
| `Date` | `DateTime` | The date that is associated with the cell. |
955954
| `IsAllDay` | `bool` | Whether the slot is inside the `AllDay` row/column.
956955
| `Resources` | `List<KeyValuePair<string, object>` | The resources that are associated with the column/row. Applicable when the Scheduler uses both - [resources]({%slug scheduler-resources%}) and [grouping]({%slug scheduler-resource-grouping%}). Needed to differentiate between the same dates within different groups. |
957-
| `SlotStartTime` | `DateTime` | The slot start time. The date is 1/1/1900, but the essential part is the time portion. |
958-
| `SlotEndTime` | `DateTime` | The slot end time. The date is 1/1/1900, but the essential part is the time portion. |
956+
| `Start` | `DateTime` | The slot start time. |
957+
| `End` | `DateTime` | The slot end time. |
959958

959+
>caption Customize certain Scheduler slots by handling the `OnCellRender` event
960960
961961
````CSHTML
962962
<style>
963963
.lunch-break {
964964
background-color: rgba(255,124,115,0.3);
965+
pointer-events:none;
965966
}
966-
967+
967968
.lunch-break::after {
968969
content: "Lunch break";
969970
}
@@ -995,8 +996,9 @@ The handler receives an argument of type `SchedulerCellRenderEventArgs` which ex
995996
DateTime lunchStart = new DateTime(1900, 1, 1, 12, 0, 0);
996997
DateTime lunchEnd = new DateTime(1900, 1, 1, 12, 30, 0);
997998
998-
if ((args.SlotStartTime.Equals(lunchStart) || args.SlotEndTime.Equals(lunchEnd)) &&
999-
(args.Date.Value.DayOfWeek != DayOfWeek.Saturday && args.Date.Value.DayOfWeek != DayOfWeek.Sunday))
999+
if ((args.Start.TimeOfDay.Equals(lunchStart.TimeOfDay) || args.End.TimeOfDay.Equals(lunchEnd.TimeOfDay)) &&
1000+
(args.Start.DayOfWeek != DayOfWeek.Saturday && args.Start.DayOfWeek != DayOfWeek.Sunday)
1001+
)
10001002
{
10011003
args.Class = "lunch-break";
10021004
}

0 commit comments

Comments
 (0)