DateRangeView
control. Users can click on a preset, e.g. "last week" to automatically select the date
range that represents last week.
Presets have to be implemented in such a way that they return the correct date range at any time, meaning the dates can not be fixed at the time of the creation of the date range, but they have to be computed on-the-fly. The UI might have been up and running for several days, hence the meaning of "last week" might have changed.
| Modifier and Type | Field and Description |
|---|---|
| private final Supplier | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | DateRangePreset(String
the title / name of the preset, e.g. "last week" title, Supplier<DateRange> the supplier returning the date range object for the preset dateRangeSupplier)Constructs a new date range preset with the given title and date range supplier. |
| Modifier and Type | Method and Description |
|---|---|
| public final Supplier | |
| public final String |
| dateRangeSupplier | back to summary |
|---|---|
| private final Supplier<DateRange> dateRangeSupplier | |
| title | back to summary |
|---|---|
| private final String title | |
| DateRangePreset | back to summary |
|---|---|
| public DateRangePreset(String title, Supplier<DateRange> dateRangeSupplier) Constructs a new date range preset with the given title and date range supplier. The supplier will be used to retrieve the date range on-the-fly when the user clicks on the preset. | |
| getDateRangeSupplier | back to summary |
|---|---|
| public final Supplier | |
| getTitle | back to summary |
|---|---|
| public final String getTitle() | |