コード例 #1
0
        private void BindYearlyCal()
        {
            string[] localizedMonths = Thread.CurrentThread.CurrentCulture.DateTimeFormat.MonthNames;

            List <CalMonths> year = new List <CalMonths>();

            for (int i = 0; i < localizedMonths.Length - 1; i++)
            {
                DateTime  date  = new DateTime(CurrentYear, i + 1, 1, CultureInfo.CurrentCulture.DateTimeFormat.Calendar);
                CalMonths month = new CalMonths();
                month.Date = date;
                year.Add(month);
            }
            rptMonths.DataSource = year;
            rptMonths.DataBind();
        }
コード例 #2
0
        private void BindYearlyCal()
        {
            string[] localizedMonths = Thread.CurrentThread.CurrentCulture.DateTimeFormat.MonthNames;

            List<CalMonths> year = new List<CalMonths>();
            for (int i = 0; i < localizedMonths.Length-1; i++)
            {
                DateTime date = new DateTime(CurrentYear, i + 1, 1, CultureInfo.CurrentCulture.DateTimeFormat.Calendar);
                CalMonths month = new CalMonths();
                month.Date = date;
                year.Add(month);
            }
            rptMonths.DataSource = year;
            rptMonths.DataBind();
        }