Search in sources :

Example 1 with LocalDateInterval

use of org.activityinfo.model.type.time.LocalDateInterval in project activityinfo by bedatadriven.

the class DateIntervalFieldWidget method getValue.

private LocalDateInterval getValue() {
    Date startDate = startDateBox.getValue();
    Date endDate = endDateBox.getValue();
    if (startDate != null && endDate != null && (startDate.equals(endDate) || startDate.before(endDate))) {
        return new LocalDateInterval(new LocalDate(startDate), new LocalDate(endDate));
    } else {
        // TODO: how do we signal the container that the value is invalid?
        return null;
    }
}
Also used : LocalDate(org.activityinfo.model.type.time.LocalDate) LocalDate(org.activityinfo.model.type.time.LocalDate) Date(java.util.Date) LocalDateInterval(org.activityinfo.model.type.time.LocalDateInterval)

Aggregations

Date (java.util.Date)1 LocalDate (org.activityinfo.model.type.time.LocalDate)1 LocalDateInterval (org.activityinfo.model.type.time.LocalDateInterval)1