List of usage examples for org.joda.time.format ISOPeriodFormat alternateExtendedWithWeeks
public static PeriodFormatter alternateExtendedWithWeeks()
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 {//from w ww. j a v a 2 s.co m return f.parsePeriod(duration); } catch (IllegalArgumentException iae) { // skip to next } } throw new IllegalArgumentException("Can't parse: " + duration); }