List of usage examples for java.util Calendar THURSDAY
int THURSDAY
To view the source code for java.util Calendar THURSDAY.
Click Source Link
From source file:com.binary_machinery.avalonschedule.view.schedule.SchedulePageFragment.java
@Nullable @Override/* w w w . j av a 2 s . c o m*/ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.schedule_page, container, false); Bundle arguments = getArguments(); FragmentManager fragmentManager = getChildFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); Func2<Integer, Integer, ?> setRecord = (dayOfWeek, layoutId) -> { String key = ARG_DAY + dayOfWeek; ScheduleRecord record = arguments.getParcelable(key); if (record != null) { Fragment fragment = (record.course != null) ? new RecordFragment() : new EmptyRecordFragment(); Bundle args = new Bundle(); args.putParcelable(RecordFragment.ARG_RECORD, record); fragment.setArguments(args); fragmentTransaction.replace(layoutId, fragment); } return 0; }; setRecord.call(Calendar.MONDAY, R.id.layoutMonday); setRecord.call(Calendar.TUESDAY, R.id.layoutTuesday); setRecord.call(Calendar.WEDNESDAY, R.id.layoutWednesday); setRecord.call(Calendar.THURSDAY, R.id.layoutThursday); setRecord.call(Calendar.FRIDAY, R.id.layoutFriday); setRecord.call(Calendar.SATURDAY, R.id.layoutSaturday); setRecord.call(Calendar.SUNDAY, R.id.layoutSunday); fragmentTransaction.commit(); return rootView; }
From source file:org.kuali.student.r2.core.scheduling.util.SchedulingServiceUtil.java
/** * Converts a list of Calendar constants (i.e. Calendar.MONDAY, Calendar.FRIDAY) into a string of characters representing those days * Used in DTO/Entity translations for TimeSlot * * @param weekdaysList//from w ww . j a v a2 s . c om * @return */ public static String weekdaysList2WeekdaysString(List<Integer> weekdaysList) { StringBuilder result = new StringBuilder(); for (Integer day : weekdaysList) { switch (day) { case Calendar.MONDAY: { result.append(SchedulingServiceConstants.MONDAY_TIMESLOT_DAY_CODE); break; } case Calendar.TUESDAY: { result.append(SchedulingServiceConstants.TUESDAY_TIMESLOT_DAY_CODE); break; } case Calendar.WEDNESDAY: { result.append(SchedulingServiceConstants.WEDNESDAY_TIMESLOT_DAY_CODE); break; } case Calendar.THURSDAY: { result.append(SchedulingServiceConstants.THURSDAY_TIMESLOT_DAY_CODE); break; } case Calendar.FRIDAY: { result.append(SchedulingServiceConstants.FRIDAY_TIMESLOT_DAY_CODE); break; } case Calendar.SATURDAY: { result.append(SchedulingServiceConstants.SATURDAY_TIMESLOT_DAY_CODE); break; } case Calendar.SUNDAY: { result.append(SchedulingServiceConstants.SUNDAY_TIMESLOT_DAY_CODE); break; } } } return result.toString(); }
From source file:calendar.services.transformers.EntryToWeekRowTransformer.java
private BigDecimal setEntryToDayInWeekRow(Entry entry, WeekRow weekRow) { Date date = entry.getDate();//from w w w .j a v a 2 s . co m Calendar cal = Calendar.getInstance(); cal.setTime(date); Integer dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); BigDecimal entryHours = entry.getHours(); switch (cal.get(Calendar.DAY_OF_WEEK)) { case Calendar.SUNDAY: weekRow.setDay7Total(weekRow.getDay7Total().add(entryHours)); weekRow.setDay7(entry.getDate()); break; case Calendar.MONDAY: weekRow.setDay1Total(weekRow.getDay1Total().add(entryHours)); weekRow.setDay1(entry.getDate()); break; case Calendar.TUESDAY: weekRow.setDay2Total(weekRow.getDay2Total().add(entryHours)); weekRow.setDay2(entry.getDate()); break; case Calendar.WEDNESDAY: weekRow.setDay3Total(weekRow.getDay3Total().add(entryHours)); weekRow.setDay3(entry.getDate()); break; case Calendar.THURSDAY: weekRow.setDay4Total(weekRow.getDay4Total().add(entryHours)); weekRow.setDay4(entry.getDate()); break; case Calendar.FRIDAY: weekRow.setDay5Total(weekRow.getDay5Total().add(entryHours)); weekRow.setDay5(entry.getDate()); break; case Calendar.SATURDAY: weekRow.setDay6Total(weekRow.getDay6Total().add(entryHours)); weekRow.setDay6(entry.getDate()); break; } return entryHours; }
From source file:JapaneseCalendar.java
public void paintComponent(Graphics g) { int width = 400; int height = 400; Calendar cal = Calendar.getInstance(locale); cal.setTime(new Date()); String header = cal.getDisplayName(Calendar.MONTH, Calendar.LONG, locale); header += " " + cal.get(Calendar.YEAR); FontMetrics fm = g.getFontMetrics(); Insets insets = getInsets();//w w w .j ava 2 s . c om g.setColor(Color.black); g.drawString(header, (width - fm.stringWidth(header)) / 2, insets.top + fm.getHeight()); DateFormatSymbols dfs = new DateFormatSymbols(locale); String[] weekdayNames = dfs.getShortWeekdays(); int fieldWidth = (width - insets.left - insets.right) / 7; g.drawString(weekdayNames[Calendar.SUNDAY], insets.left + (fieldWidth - fm.stringWidth(weekdayNames[Calendar.SUNDAY])) / 2, insets.top + 3 * fm.getHeight()); g.drawString(weekdayNames[Calendar.MONDAY], insets.left + fieldWidth + (fieldWidth - fm.stringWidth(weekdayNames[Calendar.MONDAY])) / 2, insets.top + 3 * fm.getHeight()); g.drawString(weekdayNames[Calendar.TUESDAY], insets.left + 2 * fieldWidth + (fieldWidth - fm.stringWidth(weekdayNames[Calendar.TUESDAY])) / 2, insets.top + 3 * fm.getHeight()); g.drawString(weekdayNames[Calendar.WEDNESDAY], insets.left + 3 * fieldWidth + (fieldWidth - fm.stringWidth(weekdayNames[Calendar.WEDNESDAY])) / 2, insets.top + 3 * fm.getHeight()); g.drawString(weekdayNames[Calendar.THURSDAY], insets.left + 4 * fieldWidth + (fieldWidth - fm.stringWidth(weekdayNames[Calendar.THURSDAY])) / 2, insets.top + 3 * fm.getHeight()); g.drawString(weekdayNames[Calendar.FRIDAY], insets.left + 5 * fieldWidth + (fieldWidth - fm.stringWidth(weekdayNames[Calendar.FRIDAY])) / 2, insets.top + 3 * fm.getHeight()); g.drawString(weekdayNames[Calendar.SATURDAY], insets.left + 6 * fieldWidth + (fieldWidth - fm.stringWidth(weekdayNames[Calendar.SATURDAY])) / 2, insets.top + 3 * fm.getHeight()); int dom = cal.get(Calendar.DAY_OF_MONTH); cal.set(Calendar.DAY_OF_MONTH, 1); int col = 0; switch (cal.get(Calendar.DAY_OF_WEEK)) { case Calendar.MONDAY: col = 1; break; case Calendar.TUESDAY: col = 2; break; case Calendar.WEDNESDAY: col = 3; break; case Calendar.THURSDAY: col = 4; break; case Calendar.FRIDAY: col = 5; break; case Calendar.SATURDAY: col = 6; } cal.set(Calendar.DAY_OF_MONTH, dom); int row = 5 * fm.getHeight(); for (int i = 1; i <= cal.getActualMaximum(Calendar.DAY_OF_MONTH); i++) { g.drawString("" + i, insets.left + fieldWidth * col + (fieldWidth - fm.stringWidth("" + i)) / 2, row); if (++col > 6) { col = 0; row += fm.getHeight(); } } }
From source file:com.karthikb351.vitinfo2.fragment.schedule.ScheduleFragment.java
private int getEquivalentDay(int day) { switch (day) { case Calendar.SUNDAY: day = 6;//from ww w . ja va 2s. c o m break; case Calendar.MONDAY: case Calendar.TUESDAY: case Calendar.WEDNESDAY: case Calendar.THURSDAY: case Calendar.FRIDAY: case Calendar.SATURDAY: day -= 2; break; default: day = 0; } return day; }
From source file:org.ohmage.reminders.types.time.TimeTrigDesc.java
private void initialize(boolean repeatStatus) { mIsRandomized = false;/*from w ww .j av a 2 s .c o m*/ mIsRangeEnabled = false; mRepeatList.put(getDayOfWeekString(Calendar.SUNDAY), repeatStatus); mRepeatList.put(getDayOfWeekString(Calendar.MONDAY), repeatStatus); mRepeatList.put(getDayOfWeekString(Calendar.TUESDAY), repeatStatus); mRepeatList.put(getDayOfWeekString(Calendar.WEDNESDAY), repeatStatus); mRepeatList.put(getDayOfWeekString(Calendar.THURSDAY), repeatStatus); mRepeatList.put(getDayOfWeekString(Calendar.FRIDAY), repeatStatus); mRepeatList.put(getDayOfWeekString(Calendar.SATURDAY), repeatStatus); }
From source file:com.ozpathway.sw.erms.webapp.action.schedule.ScheduleBean.java
public void addSampleHoliday(ActionEvent event) { if (model instanceof SimpleScheduleModel) { SimpleScheduleModel ssm = (SimpleScheduleModel) model; Calendar calendar = GregorianCalendar.getInstance(); calendar.setTime(ssm.getSelectedDate()); calendar.set(Calendar.DAY_OF_WEEK, Calendar.THURSDAY); ssm.setHoliday(calendar.getTime(), "Poeperkesdag"); ssm.refresh();/*from ww w .ja va 2 s. com*/ } }
From source file:org.kuali.student.r2.core.scheduling.util.SchedulingServiceUtil.java
public static List<Integer> weekdaysString2WeekdaysList(String weekdaysString) { List<Integer> result = new ArrayList<Integer>(); if (StringUtils.isNotBlank(weekdaysString)) { checkStringForDayCode(SchedulingServiceConstants.MONDAY_TIMESLOT_DAY_CODE, Calendar.MONDAY, result, weekdaysString);// w ww .j av a2 s . c o m checkStringForDayCode(SchedulingServiceConstants.TUESDAY_TIMESLOT_DAY_CODE, Calendar.TUESDAY, result, weekdaysString); checkStringForDayCode(SchedulingServiceConstants.WEDNESDAY_TIMESLOT_DAY_CODE, Calendar.WEDNESDAY, result, weekdaysString); checkStringForDayCode(SchedulingServiceConstants.THURSDAY_TIMESLOT_DAY_CODE, Calendar.THURSDAY, result, weekdaysString); checkStringForDayCode(SchedulingServiceConstants.FRIDAY_TIMESLOT_DAY_CODE, Calendar.FRIDAY, result, weekdaysString); checkStringForDayCode(SchedulingServiceConstants.SATURDAY_TIMESLOT_DAY_CODE, Calendar.SATURDAY, result, weekdaysString); checkStringForDayCode(SchedulingServiceConstants.SUNDAY_TIMESLOT_DAY_CODE, Calendar.SUNDAY, result, weekdaysString); } return result; }
From source file:com.clican.pluto.common.calendar.BusinessCalendar.java
/** * Initial method /*www .ja va 2 s . c o m*/ */ public void init() { days = new BusinessDay[8]; days[Calendar.SUNDAY] = parseDay(sunday); days[Calendar.MONDAY] = parseDay(monday); days[Calendar.TUESDAY] = parseDay(tuesday); days[Calendar.WEDNESDAY] = parseDay(wednesday); days[Calendar.THURSDAY] = parseDay(thursday); days[Calendar.FRIDAY] = parseDay(friday); days[Calendar.SATURDAY] = parseDay(saturday); holidays = new Holiday[holidayList.size()]; for (int i = 0; i < holidayList.size(); i++) { holidays[i] = parseHoliday(holidayList.get(i)); } }
From source file:org.sakaiproject.util.CalendarUtil.java
void initDates() { Calendar calendarSunday = Calendar.getInstance(); Calendar calendarMonday = Calendar.getInstance(); Calendar calendarTuesday = Calendar.getInstance(); Calendar calendarWednesday = Calendar.getInstance(); Calendar calendarThursday = Calendar.getInstance(); Calendar calendarFriday = Calendar.getInstance(); Calendar calendarSaturday = Calendar.getInstance(); calendarSunday.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); calendarMonday.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); calendarTuesday.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); calendarWednesday.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY); calendarThursday.set(Calendar.DAY_OF_WEEK, Calendar.THURSDAY); calendarFriday.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY); calendarSaturday.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY); dateSunday = calendarSunday.getTime(); dateMonday = calendarMonday.getTime(); dateTuesday = calendarTuesday.getTime(); dateWednesday = calendarWednesday.getTime(); dateThursday = calendarThursday.getTime(); dateFriday = calendarFriday.getTime(); dateSaturday = calendarSaturday.getTime(); Calendar calendarJanuary = Calendar.getInstance(); Calendar calendarFebruary = Calendar.getInstance(); Calendar calendarMarch = Calendar.getInstance(); Calendar calendarApril = Calendar.getInstance(); Calendar calendarMay = Calendar.getInstance(); Calendar calendarJune = Calendar.getInstance(); Calendar calendarJuly = Calendar.getInstance(); Calendar calendarAugust = Calendar.getInstance(); Calendar calendarSeptember = Calendar.getInstance(); Calendar calendarOctober = Calendar.getInstance(); Calendar calendarNovember = Calendar.getInstance(); Calendar calendarDecember = Calendar.getInstance(); calendarJanuary.set(Calendar.MONTH, Calendar.JANUARY); calendarFebruary.set(Calendar.MONTH, Calendar.FEBRUARY); calendarMarch.set(Calendar.MONTH, Calendar.MARCH); calendarApril.set(Calendar.MONTH, Calendar.APRIL); calendarMay.set(Calendar.MONTH, Calendar.MAY); calendarJune.set(Calendar.MONTH, Calendar.JUNE); calendarJuly.set(Calendar.MONTH, Calendar.JULY); calendarAugust.set(Calendar.MONTH, Calendar.AUGUST); calendarSeptember.set(Calendar.MONTH, Calendar.SEPTEMBER); calendarOctober.set(Calendar.MONTH, Calendar.OCTOBER); calendarNovember.set(Calendar.MONTH, Calendar.NOVEMBER); calendarDecember.set(Calendar.MONTH, Calendar.DECEMBER); dateJanuary = calendarJanuary.getTime(); dateFebruary = calendarFebruary.getTime(); dateMarch = calendarMarch.getTime(); dateApril = calendarApril.getTime(); dateMay = calendarMay.getTime();/*from w w w . j a v a 2 s . co m*/ dateJune = calendarJune.getTime(); dateJuly = calendarJuly.getTime(); dateAugust = calendarAugust.getTime(); dateSeptember = calendarSeptember.getTime(); dateOctober = calendarOctober.getTime(); dateNovember = calendarNovember.getTime(); dateDecember = calendarDecember.getTime(); }