示例#1
0
        public override Java.Lang.Object GetItem(int position)
        {
            var dateTime = DateTimes[position];
            var date     = CalendarHelper.ConvertDateTimeToDate(dateTime);

            return(date);
        }
示例#2
0
        /// <summary>
        /// To display the week day title
        /// </summary>
        /// <returns>SUN, MON, TUE, WED, THU, FRI, SAT</returns>
        protected List <string> DaysOfWeekTitles()
        {
            var daysOfWeek = new List <string>();
            var formatter  = new SimpleDateFormat("EEE", Locale.Default);

            var weekdaySunday = (int)System.DayOfWeek.Sunday;
            var daySunday     = new DateTime(2000, 10, 1);
            var day           = daySunday.AddDays(_startDayOfWeek - weekdaySunday);

            for (var i = 0; i < 7; i++)
            {
                var date         = CalendarHelper.ConvertDateTimeToDate(day);
                var dayFormatted = formatter.Format(date).ToLower();

                daysOfWeek.Add(dayFormatted);
                day = day.AddDays(1);
            }

            return(daysOfWeek);
        }