Java Code Examples for ims.framework.utils.Date.getDayOfWeek()

The following are Jave code examples for showing how to use getDayOfWeek() of the ims.framework.utils.Date class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File:   Source Code and License Vote up 6 votes
private Date validateStartDateIsSunday(Date dt)
	if (dt == null)
		return null;

	DayOfWeek weekDay = dt.getDayOfWeek();
	if (!weekDay.equals(DayOfWeek.SUNDAY))
		if (weekDay.equals(DayOfWeek.MONDAY))
		if (weekDay.equals(DayOfWeek.TUESDAY))
		if (weekDay.equals(DayOfWeek.WEDNESDAY))
		if (weekDay.equals(DayOfWeek.THURSDAY))
		if (weekDay.equals(DayOfWeek.FRIDAY))
		if (weekDay.equals(DayOfWeek.SATURDAY))

		return new Date(dt);

	return null;
Example 2
Project: AvoinApotti   File:   Source Code and License Vote up 5 votes
private DayOfWeek getDayOfWeek(Date date)
	if(date == null)
		throw new CodingRuntimeException("Coding Error = date is null (getDayOfWeek) ");
	DomainFactory factory = getDomainFactory();
	List hols = factory.find("from PublicHolidays hol where = :date", new String[]{"date"}, new Object[] {date.getDate()});
	if(hols != null && hols.size() > 0)
		return DayOfWeek.PUBLICHOLIDAY;
	DayOfWeek inst = null;
	ims.framework.utils.DayOfWeek day = date.getDayOfWeek();
		inst = DayOfWeek.MONDAY;
	else if(day.equals(ims.framework.utils.DayOfWeek.TUESDAY))
		inst = DayOfWeek.TUESDAY;
	else if(day.equals(ims.framework.utils.DayOfWeek.WEDNESDAY))
		inst = DayOfWeek.WEDNESDAY;
	else if(day.equals(ims.framework.utils.DayOfWeek.THURSDAY))
		inst = DayOfWeek.THURSDAY;
	else if(day.equals(ims.framework.utils.DayOfWeek.FRIDAY))
		inst = DayOfWeek.FRIDAY;
	else if(day.equals(ims.framework.utils.DayOfWeek.SATURDAY))
		inst = DayOfWeek.SATURDAY;
	else if(day.equals(ims.framework.utils.DayOfWeek.SUNDAY))
		inst = DayOfWeek.SUNDAY;
	return inst;