public static int DateOfWeekday(int date, int weekday) {
		if (weekday == 0) {
			return date;
		}
		int curweekday = date % 7;
		boolean isPos = false;
		if (weekday > 0) {
			isPos = true;
		}
		weekday = weekday % 7;

		if (weekday >= 0) {
			if (weekday == curweekday && isPos) {
				return date + 7;
			} else if (weekday > curweekday) {
				return date + (weekday - curweekday);
			} else {
				return date + 7 - (curweekday - weekday);
			}
		} else {
			if (weekday == curweekday && !isPos) {
				return date - 7;
			} else if (curweekday > Math.abs(weekday)) {
				return date - (curweekday - Math.abs(weekday));
			} else {
				return date - (7 - (Math.abs(weekday) - curweekday));
			}
		}
	}