List of usage examples for org.joda.time Weeks parseWeeks
@FromString public static Weeks parseWeeks(String periodStr)
Weeks
by parsing a string in the ISO8601 format 'PnW'. From source file:griffon.plugins.jodatime.editors.WeeksPropertyEditor.java
License:Apache License
private void handleAsString(String str) { if (isBlank(str)) { super.setValueInternal(null); return;/*from w w w. j ava 2 s . c o m*/ } try { super.setValueInternal(parse(Integer.parseInt(str))); return; } catch (NumberFormatException nfe) { // ignore } try { super.setValueInternal(Weeks.parseWeeks(str)); } catch (IllegalArgumentException e) { throw illegalValue(str, Weeks.class, e); } }