2020-04-28 15:56:56 +08:00
|
|
|
|
@namespace AntBlazor.Internal
|
2020-05-18 14:46:42 +08:00
|
|
|
|
@inherits DatePickerPanelBase
|
2020-04-28 15:56:56 +08:00
|
|
|
|
@using System.Globalization;
|
|
|
|
|
|
|
|
|
|
@{
|
|
|
|
|
var calendar = CultureInfo.InvariantCulture.Calendar;
|
|
|
|
|
|
|
|
|
|
DateTime startDate = new DateTime(PickerValue.Year, 1, 1);
|
|
|
|
|
|
|
|
|
|
const int MAX_ROW = 4;
|
|
|
|
|
const int MAX_COL = 3;
|
|
|
|
|
|
|
|
|
|
string inViewClass = $"{DatePicker.PrefixCls}-cell-in-view";
|
|
|
|
|
}
|
2020-05-18 14:46:42 +08:00
|
|
|
|
<DatePickerTemplate
|
2020-04-28 15:56:56 +08:00
|
|
|
|
PickerIndex="@PickerIndex"
|
|
|
|
|
MaxRow="MAX_ROW"
|
|
|
|
|
MaxCol="MAX_COL"
|
|
|
|
|
ViewStartDate="startDate"
|
|
|
|
|
IsInView="date => true"
|
|
|
|
|
IsToday="date => DateHelper.IsSameMonth(date, DatePicker.CurrentDate)"
|
|
|
|
|
IsSelected="date => DateHelper.IsSameMonth(date, Value)"
|
|
|
|
|
GetColTitle='date => date.ToString("yyyy")'
|
|
|
|
|
OnValueSelect="date => OnSelectMonth(date)"
|
|
|
|
|
GetNextColValue="date => date.AddMonths(1)">
|
|
|
|
|
<RenderPickerHeader>
|
2020-05-18 14:46:42 +08:00
|
|
|
|
<DatePickerHeader PickerIndex="@PickerIndex"
|
2020-04-28 15:56:56 +08:00
|
|
|
|
ShowNextChange="@false"
|
|
|
|
|
ShowPreChange="@false"
|
|
|
|
|
ShowSuperPreChange="@(!(DatePicker.IsRange && PickerIndex == 1))"
|
|
|
|
|
ShowSuperNextChange="@(!(DatePicker.IsRange && PickerIndex == 0))"/>
|
|
|
|
|
</RenderPickerHeader>
|
|
|
|
|
<RenderColValue Context="currentColDate">
|
|
|
|
|
@(currentColDate.Month)月
|
|
|
|
|
</RenderColValue>
|
2020-05-18 14:46:42 +08:00
|
|
|
|
</DatePickerTemplate>
|