@namespace AntDesign
@inherits AntDomComponentBase
@using AntDesign.Internal
@code
{
[CascadingParameter(Name = "PrefixCls")]
public string PrefixCls { get; set; }
[CascadingParameter(Name = "Calendar")]
public Calendar Calendar { get; set; }
private DateTime currentDate;
private int _yearValue;
private int _monthValue;
protected override void OnInitialized()
{
base.OnInitialized();
currentDate = Calendar.Value;
}
private void OnModeChange(string value)
{
Calendar.ChangePickerType(value);
}
private async Task OnSelectYear(string value)
{
int year = Convert.ToInt32(value);
await Calendar.ChangeValue(DateHelper.CombineNewDate(Calendar.Value, year: year));
}
private async Task OnSelectMonth(string value)
{
int month = Convert.ToInt32(value);
await Calendar.ChangeValue(DateHelper.CombineNewDate(Calendar.Value, month: month));
}
}