public Date floor(Date date, int field) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		for (int currentField : fields) {
			if (currentField > field) {
				if (currentField == Calendar.DAY_OF_MONTH
						&& (field == Calendar.WEEK_OF_MONTH || field == Calendar.WEEK_OF_YEAR)) {
					continue;
				}
				cal.set(currentField, cal.getActualMinimum(currentField));
			}
		}
		if (field == Calendar.WEEK_OF_MONTH || field == Calendar.WEEK_OF_YEAR) {
			cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek());
		}
		return cal.getTime();
	}