case 'M': calUnit = Calendar.MONTH; break;
case 'q': calUnit = Calendar.MONTH; dur *= 3; break;
case 'y': calUnit = Calendar.YEAR; break;
case 'D': calUnit = Calendar.YEAR; dur *= 10; break; // decade
case 'C': calUnit = Calendar.YEAR; dur *= 100; break; // century :-D go long!
default : throw new WrappedException(new ScriptusRuntimeException("unrecognised unit: "+unit));
}
until.add(calUnit, dur);
}
}
}
if( ! foundDate) {
throw new WrappedException(new ScriptusRuntimeException("Could not recognise duration argument: "+o+" must either be integer >1, or match date format "+ScriptusConfig.DATE_FORMAT+" or duration format regexp "+ScriptusConfig.DURATION_FORMAT));
}
return until;
}