mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 01:11:52 +08:00
d99f4f35a8
* feat: add localization option to DatePicker * fix(module: datepicker): fix formatting issue * fix: fix Week/Year panel miss matching fix picker not update when setting CultureInfo fix ShortWeekDays names and order * fix: fix binding of CultureInfo in datetime demos Add globalization demo * fix: datetime string format Co-authored-by: ElderJames <shunjiey@hotmail.com>
39 lines
1.6 KiB
C#
39 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 = 1;
|
|
const int MAX_COL = 4;
|
|
}
|
|
|
|
<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)"
|
|
GetColTitle='date => date.ToString(this.DatePicker.CultureInfo.GetDateLocale().YearFormat, this.DatePicker.CultureInfo)'
|
|
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> |