use of org.olat.modules.qpool.model.LOMDuration in project openolat by klemens.
the class MetadataConverterHelper method convertDuration.
public static LOMDuration convertDuration(String durationStr) {
LOMDuration duration = new LOMDuration();
if (StringHelper.containsNonWhitespace(durationStr) && durationStr.startsWith("P")) {
// remove p
durationStr = durationStr.substring(1, durationStr.length());
int indexT = durationStr.indexOf('T');
if (indexT < 0) {
convertDurationP(durationStr, duration);
} else {
String pDurationStr = durationStr.substring(0, indexT);
convertDurationP(pDurationStr, duration);
String tDurationStr = durationStr.substring(indexT + 1, durationStr.length());
convertDurationT(tDurationStr, duration);
}
}
return duration;
}
Aggregations