@@ -78,16 +78,11 @@ The example below shows the signature of the event handlers so you can copy the
78
78
OnDelete="@DeleteAppointment"
79
79
OnEdit="@EditHandler" OnCancel="@CancelHandler"
80
80
AllowCreate="true" AllowDelete="true" AllowUpdate="true"
81
- @bind-Date="@StartDate" Height="600px" @bind-View="@CurrView"
82
- StartField="@(nameof(SchedulerAppointment.StartTime))"
83
- EndField="@(nameof(SchedulerAppointment.EndTime))"
84
- TitleField="@(nameof(SchedulerAppointment.Title))"
85
- DescriptionField="@(nameof(SchedulerAppointment.Description))"
86
- IsAllDayField="@(nameof(SchedulerAppointment.IsAllDay))">
81
+ @bind-Date="@StartDate" Height="600px" @bind-View="@CurrView">
87
82
<SchedulerViews>
88
- <SchedulerDayView StartTime="@DayStart" EndTime="@DayEnd" WorkDayStart="@WorkDayStart" WorkDayEnd="@WorkDayEnd" />
89
- <SchedulerWeekView StartTime="@DayStart" EndTime="@DayEnd" WorkDayStart="@WorkDayStart" WorkDayEnd="@WorkDayEnd" />
90
- <SchedulerMultiDayView StartTime="@DayStart" EndTime="@DayEnd" WorkDayStart="@WorkDayStart" WorkDayEnd="@WorkDayEnd" NumberOfDays="10" />
83
+ <SchedulerDayView StartTime="@DayStart" />
84
+ <SchedulerWeekView StartTime="@DayStart" />
85
+ <SchedulerMultiDayView StartTime="@DayStart" NumberOfDays="10" />
91
86
</SchedulerViews>
92
87
</TelerikScheduler>
93
88
@@ -102,8 +97,8 @@ The example below shows the signature of the event handlers so you can copy the
102
97
{
103
98
matchingItem.Title = item.Title;
104
99
matchingItem.Description = item.Description;
105
- matchingItem.StartTime = item.StartTime ;
106
- matchingItem.EndTime = item.EndTime ;
100
+ matchingItem.Start = item.Start ;
101
+ matchingItem.End = item.End ;
107
102
matchingItem.IsAllDay = item.IsAllDay;
108
103
}
109
104
@@ -141,8 +136,8 @@ The example below shows the signature of the event handlers so you can copy the
141
136
else
142
137
{
143
138
// get the time range of the slot the user clicked to add an appointment
144
- DateTime slotStart = item.StartTime ;
145
- DateTime slotEnd = item.EndTime ;
139
+ DateTime slotStart = item.Start ;
140
+ DateTime slotEnd = item.End ;
146
141
}
147
142
}
148
143
@@ -154,48 +149,56 @@ The example below shows the signature of the event handlers so you can copy the
154
149
}
155
150
156
151
// sample data and scheduler settings
157
- public DateTime StartDate { get; set; } = new DateTime(2019, 11, 29);
158
152
public SchedulerView CurrView { get; set; } = SchedulerView.Week;
159
- //the time portions are important
160
- public DateTime DayStart { get; set; } = new DateTime(2000, 1, 1, 8, 0, 0);
161
- public DateTime DayEnd { get; set; } = new DateTime(2000, 1, 1, 20, 0, 0);
162
- public DateTime WorkDayStart { get; set; } = new DateTime(2000, 1, 1, 9, 0, 0);
163
- public DateTime WorkDayEnd { get; set; } = new DateTime(2000, 1, 1, 17, 0, 0);
153
+ public DateTime StartDate { get; set; } = new DateTime(2019, 12, 2);
154
+ public DateTime DayStart { get; set; } = new DateTime(2000, 1, 1, 8, 0, 0); //the time portion is important
164
155
List<SchedulerAppointment> Appointments = new List<SchedulerAppointment>()
165
156
{
166
157
new SchedulerAppointment
167
158
{
159
+ Id = Guid.NewGuid(),
160
+ Title = "Board meeting",
161
+ Description = "Q4 is coming to a close, review the details.",
162
+ Start = new DateTime(2019, 12, 5, 10, 00, 0),
163
+ End = new DateTime(2019, 12, 5, 11, 30, 0)
164
+ },
165
+
166
+ new SchedulerAppointment
167
+ {
168
+ Id = Guid.NewGuid(),
168
169
Title = "Vet visit",
169
170
Description = "The cat needs vaccinations and her teeth checked.",
170
- StartTime = new DateTime(2019, 11, 26 , 11, 30, 0),
171
- EndTime = new DateTime(2019, 11, 26 , 12, 0, 0)
171
+ Start = new DateTime(2019, 12, 2 , 11, 30, 0),
172
+ End = new DateTime(2019, 12, 2 , 12, 0, 0)
172
173
},
173
174
174
175
new SchedulerAppointment
175
176
{
177
+ Id = Guid.NewGuid(),
176
178
Title = "Planning meeting",
177
179
Description = "Kick off the new project.",
178
- StartTime = new DateTime(2019, 11, 25 , 9, 30, 0),
179
- EndTime = new DateTime(2019, 11, 25 , 12, 45, 0)
180
+ Start = new DateTime(2019, 12, 6 , 9, 30, 0),
181
+ End = new DateTime(2019, 12, 6 , 12, 45, 0)
180
182
},
181
183
182
184
new SchedulerAppointment
183
185
{
186
+ Id = Guid.NewGuid(),
184
187
Title = "Trip to Hawaii",
185
188
Description = "An unforgettable holiday!",
186
189
IsAllDay = true,
187
- StartTime = new DateTime(2019, 11, 27),
188
- EndTime = new DateTime(2019, 12, 07 )
190
+ Start = new DateTime(2019, 11, 27),
191
+ End = new DateTime(2019, 12, 05 )
189
192
}
190
193
};
191
194
192
195
public class SchedulerAppointment
193
196
{
194
- public int Id { get; set; }
197
+ public Guid Id { get; set; }
195
198
public string Title { get; set; }
196
199
public string Description { get; set; }
197
- public DateTime StartTime { get; set; }
198
- public DateTime EndTime { get; set; }
200
+ public DateTime Start { get; set; }
201
+ public DateTime End { get; set; }
199
202
public bool IsAllDay { get; set; }
200
203
}
201
204
}
0 commit comments