Example usage for org.joda.time Days parseDays

List of usage examples for org.joda.time Days parseDays

Introduction

In this page you can find the example usage for org.joda.time Days parseDays.

Prototype

@FromString
public static Days parseDays(String periodStr) 

Source Link

Document

Creates a new Days by parsing a string in the ISO8601 format 'PnD'.

Usage

From source file:griffon.plugins.jodatime.editors.DaysPropertyEditor.java

License:Apache License

private void handleAsString(String str) {
    if (isBlank(str)) {
        super.setValueInternal(null);
        return;//from w  w w .j a v  a2  s. c  o  m
    }

    try {
        super.setValueInternal(parse(Integer.parseInt(str)));
        return;
    } catch (NumberFormatException nfe) {
        // ignore
    }

    try {
        super.setValueInternal(Days.parseDays(str));
    } catch (IllegalArgumentException e) {
        throw illegalValue(str, Days.class, e);
    }
}