@namespace AntDesign.Internal @typeparam TValue @inherits DatePickerPanelBase @using AntDesign
@if (IsShowHeader) { @RenderPickerHeader }
@RenderTableHeader @{ var startDate = ViewStartDate; bool shouldStopRender = false; DateTime monthFirstDayDate = new DateTime(PickerValue.Year, PickerValue.Month, 1, 0, 0, 0); bool firstWeekNotInMonth = ViewStartDate.AddDays(7).Equals(monthFirstDayDate); } @for (int row = 1; row <= MaxRow; row++) { if (shouldStopRender) { break; } var startColDate = startDate; @RenderFirstCol?.Invoke(startColDate.CompareTo(monthFirstDayDate) < 0 && !firstWeekNotInMonth ? monthFirstDayDate : startColDate) @for (int col = 1; col <= MaxCol; col++) { if (shouldStopRender) { break; } if (Picker == DatePickerType.Date && row == 1 && col <= SkipDays) { } else { var currentColDate = startDate; string cellCls = GetCellCls(currentColDate); string innerCellCls = GetInnerCellCls(currentColDate); startDate = @GetNextColValue(currentColDate); if (ShouldStopRenderDate(currentColDate, startDate)) { shouldStopRender = true; } } } @{ var endColDate = startDate;} @RenderLastCol?.Invoke(endColDate) }
@if (IsCalendar) {
@if (Picker == DatePickerType.Date && DateRender != null) { @(DateRender(currentColDate, DatePicker.CurrentDate)) } else if (Picker == DatePickerType.Month && MonthCellRender != null) { @(MonthCellRender(currentColDate)) } else { @RenderColValue(currentColDate) }
@if (Picker == DatePickerType.Date && CalendarDateRender != null) { @(CalendarDateRender(currentColDate)) } else if (Picker == DatePickerType.Month && CalendarMonthCellRender != null) { @(CalendarMonthCellRender(currentColDate)) }
} else { @if (Picker == DatePickerType.Date && DateRender != null) { @(DateRender(currentColDate, DatePicker.CurrentDate)) } else if (Picker == DatePickerType.Month && MonthCellRender != null) { @(MonthCellRender(currentColDate)) } else { @RenderColValue(currentColDate) } }