Code example for GregorianCalendar

Methods: add, format, get

0
		 * @param d Date in format dd.MM.yyyy. 
		 * @return <code>true</code>, if the date is the next wednesday. 
		 */ 
		private boolean isNextWednesday(String d) {
			if (nextWednesday == null) {
				GregorianCalendar today = new GregorianCalendar();
 
				int diff = GregorianCalendar.WEDNESDAY -
							today.get(GregorianCalendar.DAY_OF_WEEK);
 
				if (!(diff >= 0)) {
					diff += 7;
				} 
				today.add(GregorianCalendar.DAY_OF_MONTH, diff);
				nextWednesday = DateFormat.format("dd.MM.yyyy", today).toString();
			} 
 
			if (nextWednesday.equals(d)) {
				return true; 
			}