/** * Constructor. */ public CalendarModel() { currentMonth = new Date(); CalendarUtil.setToFirstDayOfMonth(currentMonth); // Finding day of week names Date date = new Date(); for (int i = 1; i <= DAYS_IN_WEEK; i++) { date.setDate(i); int dayOfWeek = date.getDay(); dayOfWeekNames[dayOfWeek] = getDayOfWeekFormatter().format(date); } // Finding day of month names date.setMonth(0); for (int i = 1; i < MAX_DAYS_IN_MONTH; ++i) { date.setDate(i); dayOfMonthNames[i] = getDayOfMonthFormatter().format(date); } // finding month names date.setDate(1); for (int i = 0; i < MONTHS_IN_YEAR; ++i) { date.setMonth(i); monthOfYearNames[i] = getMonthFormatter().format(date); } }
/** * Constructor. */ public CalendarModel() { currentMonth = new Date(); CalendarUtil.setToFirstDayOfMonth(currentMonth); // Finding day of week names Date date = new Date(); for (int i = 1; i <= DAYS_IN_WEEK; i++) { date.setDate(i); int dayOfWeek = date.getDay(); dayOfWeekNames[dayOfWeek] = getDayOfWeekFormatter().format(date); } // Finding day of month names date.setMonth(0); for (int i = 1; i < MAX_DAYS_IN_MONTH; ++i) { date.setDate(i); dayOfMonthNames[i] = getDayOfMonthFormatter().format(date); } // finding month names date.setDate(1); for (int i = 0; i < MONTHS_IN_YEAR; ++i) { date.setMonth(i); monthOfYearNames[i] = getMonthFormatter().format(date); } }
/** * Constructor. */ public CalendarModel() { currentMonth = new Date(); CalendarUtil.setToFirstDayOfMonth(currentMonth); // Finding day of week names Date date = new Date(); for (int i = 1; i <= DAYS_IN_WEEK; i++) { date.setDate(i); int dayOfWeek = date.getDay(); dayOfWeekNames[dayOfWeek] = getDayOfWeekFormatter().format(date); } // Finding day of month names date.setMonth(0); for (int i = 1; i < MAX_DAYS_IN_MONTH; ++i) { date.setDate(i); dayOfMonthNames[i] = getDayOfMonthFormatter().format(date); } // finding month names date.setDate(1); for (int i = 0; i < MONTHS_IN_YEAR; ++i) { date.setMonth(i); monthOfYearNames[i] = getMonthFormatter().format(date); } }