2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign.Internal
|
2020-06-01 14:09:28 +08:00
|
|
|
|
@typeparam TValue
|
|
|
|
|
@inherits DatePickerPanelBase<TValue>
|
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-06-03 10:24:16 +08:00
|
|
|
|
|
|
|
|
|
<div class='@($"{PrefixCls}-panel")'>
|
|
|
|
|
<DatePickerTemplate @attributes="GetAttritubes()"
|
|
|
|
|
TValue="TValue"
|
|
|
|
|
MaxRow="MAX_ROW"
|
|
|
|
|
MaxCol="MAX_COL"
|
|
|
|
|
ViewStartDate="startDate"
|
|
|
|
|
IsInView="date => true"
|
|
|
|
|
IsToday="date => DateHelper.IsSameQuarter(date, DatePicker.CurrentDate)"
|
|
|
|
|
IsSelected="date => DateHelper.IsSameQuarter(date, Value)"
|
2020-11-25 11:08:12 +08:00
|
|
|
|
GetColTitle='date => date.ToString(Locale.Lang.YearFormat, CultureInfo)'
|
2020-06-03 10:24:16 +08:00
|
|
|
|
OnValueSelect="date => OnSelectQuarter(date)"
|
|
|
|
|
GetNextColValue="date => date.AddMonths(3)">
|
|
|
|
|
<RenderPickerHeader>
|
|
|
|
|
<DatePickerHeader @attributes="GetAttritubes()"
|
|
|
|
|
TValue="TValue"
|
|
|
|
|
ShowPreChange="@false"
|
|
|
|
|
ShowNextChange="@false"
|
|
|
|
|
ShowSuperPreChange="@(!(IsRange && PickerIndex == 1))"
|
|
|
|
|
ShowSuperNextChange="@(!(IsRange && PickerIndex == 0))" />
|
|
|
|
|
</RenderPickerHeader>
|
|
|
|
|
<RenderColValue Context="currentColDate">
|
|
|
|
|
@DateHelper.GetDayOfQuarter(currentColDate)
|
|
|
|
|
</RenderColValue>
|
|
|
|
|
</DatePickerTemplate>
|
|
|
|
|
</div>
|