@namespace AntDesign.Internal @typeparam TValue @inherits DatePickerPanelBase @using System.Globalization; @{ var calendar = CultureInfo.InvariantCulture.Calendar; int startYear = PickerValue.Year / 10 * 10 - 1; DateTime startDate; if (startYear > 0) startDate = new DateTime(startYear, 1, 1); else startDate = DateTime.MinValue; int yearIndex = 0; }
@{yearIndex++;} @currentColDate.Year
@code { private const int MAX_ROW = 4; private const int MAX_COL = 3; private const int FIRST_YEAR_INDEX = 0; private const int LAST_YEAR_INDEX = MAX_ROW * MAX_COL - 1; private bool IsInView(DateTime date, DateTime startDate) { return date.Year != startDate.AddYears(FIRST_YEAR_INDEX).Year && date.Year != startDate.AddYears(LAST_YEAR_INDEX).Year; } }