List of usage examples for org.joda.time.format ISOPeriodFormat alternateWithWeeks
public static PeriodFormatter alternateWithWeeks()
From source file:colossal.pipe.BaseOptions.java
License:Apache License
private Period parseDuration() { PeriodFormatter[] toTry = { PeriodFormat.getDefault(), ISOPeriodFormat.standard(), ISOPeriodFormat.alternate(), ISOPeriodFormat.alternateExtended(), ISOPeriodFormat.alternateExtendedWithWeeks(), ISOPeriodFormat.alternateWithWeeks() }; for (PeriodFormatter f : toTry) { try {/* ww w . j av a 2s .co m*/ return f.parsePeriod(duration); } catch (IllegalArgumentException iae) { // skip to next } } throw new IllegalArgumentException("Can't parse: " + duration); }