<EjsDateRangePicker Placeholder="Choose a Range" StartDate="@CheckIn" EndDate="@CheckOut" ValueChanged="@onDateChange"></EjsDateRangePicker>
private void onDateChange(RangeEventArgs args)
{
CheckIn = args.StartDate;
CheckOut = args.EndDate;
StateHasChanged();
}
<EjsDateRangePicker ID="date-range">
<DateRangePickerEvents ValueChange="@valueChange"></DateRangePickerEvents>
</EjsDateRangePicker>
@code {
public void valueChange(Syncfusion.EJ2.Blazor.Calendars.RangeEventArgs args)
{
this.Data.Add(new PlaylistItemModel() { Title = "Change Eventtriggered" });
this.StateHasChanged();
}
} |
@using Syncfusion.EJ2.Blazor.Calendars
<p>DateRangePicker StarteDate and EndDate is: <strong> @StartValue </strong> and <strong> @EndValue </strong></p>
<EjsDateRangePicker StartDate="@StartValue" EndDate="@EndValue" ValueChange="@onChange"></EjsDateRangePicker>
@code {
public DateTime StartValue { get; set; } = DateTime.Now;
public DateTime EndValue { get; set; } = DateTime.Now;
private void onChange(RangeEventArgs args)
{
StartValue = args.StartDate;
EndValue = args.EndDate;
StateHasChanged();
}
}