2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign.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 = 1;
|
|
|
|
|
const int MAX_COL = 4;
|
|
|
|
|
}
|
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.IsSameQuarter(date, DatePicker.CurrentDate)"
|
|
|
|
|
IsSelected="date => DateHelper.IsSameQuarter(date, Value)"
|
|
|
|
|
GetColTitle='date => date.ToString("yyyy")'
|
|
|
|
|
OnValueSelect="date => OnSelectQuarter(date)"
|
|
|
|
|
GetNextColValue="date => date.AddMonths(3)">
|
|
|
|
|
<RenderPickerHeader>
|
2020-05-18 14:46:42 +08:00
|
|
|
|
<DatePickerHeader PickerIndex="@PickerIndex"
|
2020-04-28 15:56:56 +08:00
|
|
|
|
ShowPreChange="@false"
|
|
|
|
|
ShowNextChange="@false"
|
|
|
|
|
ShowSuperPreChange="@(!(DatePicker.IsRange && PickerIndex == 1))"
|
|
|
|
|
ShowSuperNextChange="@(!(DatePicker.IsRange && PickerIndex == 0))" />
|
|
|
|
|
</RenderPickerHeader>
|
|
|
|
|
<RenderColValue Context="currentColDate">
|
|
|
|
|
@DateHelper.GetDayOfQuarter(currentColDate)
|
|
|
|
|
</RenderColValue>
|
2020-05-18 14:46:42 +08:00
|
|
|
|
</DatePickerTemplate>
|