public static Range parse(String value, DateFormat dateFormat) {
		final int index = value.indexOf(CUSTOM_PERIOD_SEPARATOR);
		if (index == -1) {
			try {
				return Period.valueOfIgnoreCase(value).getRange();
			} catch (final IllegalArgumentException e) {
				return Period.JOUR.getRange();
			}
		}
		// rq: on pourrait essayer aussi des dateFormat alternatifs,
		// par exemple même pattern mais sans les slashs ou juste avec jour et mois
		Date startDate;
		try {
			startDate = dateFormat.parse(value.substring(0, index));
		} catch (final ParseException e) {
			startDate = new Date();
		}

		Date endDate;
		if (index < value.length() - 1) {
			try {
				endDate = dateFormat.parse(value.substring(index + 1));
			} catch (final ParseException e) {
				endDate = new Date();
			}
		} else {
			endDate = new Date();
		}

		return createCustomRange(startDate, endDate);
	}
@Test
	public void testParse() {
		I18N.bindLocale(Locale.FRENCH);
		try {
			final DateFormat dateFormat = I18N.createDateFormat();
			assertEquals("parse1", periodRange.getPeriod(),
					Range.parse(periodRange.getValue(), dateFormat).getPeriod());
			assertTrue("parse2", isSameDay(customRange.getStartDate(),
					Range.parse(customRange.getValue(), dateFormat).getStartDate()));
			assertTrue("parse3", isSameDay(customRange.getEndDate(),
					Range.parse(customRange.getValue(), dateFormat).getEndDate()));

			// on teste le résultat en cas d'erreur de format
			assertNotNull("parse4", Range
					.parse("xxxxxx" + Range.CUSTOM_PERIOD_SEPARATOR + "01/01/2010", dateFormat));
			assertNotNull("parse5", Range
					.parse("01/01/2010" + Range.CUSTOM_PERIOD_SEPARATOR + "xxxxxx", dateFormat));
			assertNotNull("parse6",
					Range.parse("01/01/2010" + Range.CUSTOM_PERIOD_SEPARATOR, dateFormat));
			assertNotNull("parse6b", Range.parse("01/01/2011", dateFormat));
			// on teste les bornes min et max
			final Calendar calendar = Calendar.getInstance();
			final int currentYear = calendar.get(Calendar.YEAR);
			Range range = Range.parse("01/01/2000" + Range.CUSTOM_PERIOD_SEPARATOR + "01/01/2030",
					dateFormat);
			calendar.setTime(range.getStartDate());
			assertTrue("parse7", calendar.get(Calendar.YEAR) >= currentYear - 2);
			calendar.setTime(range.getEndDate());
			assertTrue("parse7", calendar.get(Calendar.YEAR) <= currentYear);
			range = Range.parse("01/01/2030" + Range.CUSTOM_PERIOD_SEPARATOR + "01/01/2030",
					dateFormat);
			calendar.setTime(range.getStartDate());
			assertTrue("parse8", calendar.get(Calendar.YEAR) <= currentYear);
		} finally {
			I18N.unbindLocale();
		}
	}