* @param date2 second parameter. Can be null.
	 * @return days between parameters. Can be negative when date2 is before date1. Returns 0 if any parameter is null.
	 */
	public static int toDaysBetween(Date date1, Date date2) {
		if (date1 == null || date2 == null) {
			return 0;
		}
		Date fromDate, toDate;
		if (date1.before(date2)) {
			fromDate = date1;
			toDate = date2;
		} else {
			fromDate = date2;
			toDate = date1;
		}

		Calendar c = Calendar.getInstance();
		c.setTime(fromDate);

		int i = 0;
		while (c.getTime().before(toDate)) {
			c.add(Calendar.DATE, 1);
			i += 1;
		}
		return date1.before(date2) ? i : -i;
	}