Skip to content

Commit 1a3157e

Browse files
authored
docs(calendar): Update single selection example, based on docs feedback
1 parent 88f360f commit 1a3157e

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

components/calendar/selection.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ You can find examples of both below.
5454
>caption Two-way binding for the selected date
5555
5656
````CSHTML
57-
@* With single selection, you can use two-way binding of the selected date *@
58-
5957
<TelerikCalendar @bind-Date="@startDate"
6058
@bind-Value="@SelectedDate"
6159
SelectionMode="@CalendarSelectionMode.Single">
@@ -74,24 +72,24 @@ You can find examples of both below.
7472
>caption Handle Single selection in the Calendar through an event
7573
7674
````CSHTML
77-
@* This example shows how to handle Single selection *@
78-
79-
<TelerikCalendar @bind-Date="@startDate"
75+
<TelerikCalendar @bind-Date="@StartDate"
8076
SelectionMode="@CalendarSelectionMode.Single"
77+
Value="@SelectedDate"
8178
ValueChanged="SelectionHandler">
8279
</TelerikCalendar>
8380
8481
<p>
85-
Selected Date: @SelectedDate
82+
Selected Date: @SelectedDate.ToShortDateString()
8683
</p>
8784
8885
@code {
89-
private DateTime SelectedDate { get; set; }
90-
private DateTime startDate = new DateTime(2019, 5, 2);
86+
private DateTime SelectedDate { get; set; } = DateTime.Today;
87+
88+
private DateTime StartDate = DateTime.Today;
9189
92-
public void SelectionHandler(DateTime selectedDate)
90+
private void SelectionHandler(DateTime newDate)
9391
{
94-
SelectedDate = selectedDate;
92+
SelectedDate = newDate;
9593
}
9694
}
9795
````
@@ -104,8 +102,6 @@ With multiple selection mode, to get the user selection, use the `SelectedDates`
104102
>caption Handle Multiple selection in the Calendar
105103
106104
````CSHTML
107-
@* This example shows how to handle Multiple selection *@
108-
109105
<TelerikCalendar @ref="@CalendarRef"
110106
SelectionMode="@CalendarSelectionMode.Multiple"
111107
ValueChanged="@OnCalendarValueChanged">

0 commit comments

Comments
 (0)