mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-03 12:37:40 +08:00
cf959decf9
* feat: refactor datePicker, add Calendar(basic) * feat: add calendar and demos * fix: timePicker format error * fix: release comments * refactor: replace @bind-Value with Value * refactor: replace @bind-Value with Value * fix: conflit
41 lines
1.6 KiB
C#
41 lines
1.6 KiB
C#
@namespace AntDesign.Internal
|
|
@typeparam TValue
|
|
@inherits DatePickerPanelBase<TValue>
|
|
@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 = $"{PrefixCls}-cell-in-view";
|
|
}
|
|
|
|
<div class='@($"{PrefixCls}-panel")'>
|
|
<DatePickerTemplate @attributes="GetAttritubes()"
|
|
TValue="TValue"
|
|
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>
|
|
<DatePickerHeader @attributes="GetAttritubes()"
|
|
TValue="TValue"
|
|
ShowNextChange="@false"
|
|
ShowPreChange="@false"
|
|
ShowSuperPreChange="@(!(IsRange && PickerIndex == 1))"
|
|
ShowSuperNextChange="@(!(IsRange && PickerIndex == 0))" />
|
|
</RenderPickerHeader>
|
|
<RenderColValue Context="currentColDate">
|
|
@(currentColDate.Month)月
|
|
</RenderColValue>
|
|
</DatePickerTemplate>
|
|
</div> |