int value = stepper.getValue() != null ? (Integer) stepper.getValue() : 0;
latestDate.setValue(DateUtil.addDays(new Date(), -value));
}
private HorizontalLayout createDateRangeControls() {
fromDate = new OptionalDateField(messageSource);
fromDate.setValue(DateUtil.addDays(new Date(), -5));
fromDate.addDateChangedListener(new ValueChangeListener() {
@Override
public void valueChange(Property.ValueChangeEvent event) {
updateValues();
}
});
toDate = new OptionalDateField(messageSource);
toDate.setValue(new Date());
toDate.addDateChangedListener(new ValueChangeListener() {
@Override
public void valueChange(Property.ValueChangeEvent event) {
updateValues();