public class DateRange extends Object implements org.apache.wicket.util.io.IClusterable
RangeDatePicker and RangeDatePickerTextFieldstart and end dates are UTC based, the JSON array (toString()) is timezone agnostic| Constructor and Description |
|---|
DateRange(Date start,
Date end)
Constructor
|
DateRange(long start,
long end)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Date |
getEnd()
Gets the end date
|
Date |
getStart()
Gets the start date
|
static DateFormat |
newDateFormat()
Gets a new UTC
DateFormat using ISO8601 pattern, but timezone agnostic |
static DateRange |
of(Date start,
Date end)
Creates a new
DateRange, UTC time, starting at 0:00:00.000 and ending at 23:59:59.999Caution: supplied dates should be local to the system (ie: new Date()). |
static DateRange |
of(long start,
long end)
Creates a new
DateRange, starting at 0:00:00.000 and ending at 23:59:59.999Caution: supplied dates should be UTC. |
void |
setEnd(Date date)
Sets the end date.
|
void |
setEnd(long date)
Sets the end date.
|
void |
setStart(Date date)
Sets the start date.
|
void |
setStart(long date)
Sets the start date.
|
static DateRange |
today()
Gets a default
DateRange from today 0:00:00.000 to 23:59:59.999 (UTC). |
String |
toString() |
public static final String PATTERN
public DateRange(Date start, Date end)
start - the local start dateend - the local end datepublic DateRange(long start,
long end)
start - the UTC start dateend - the UTC end datepublic static DateRange of(Date start, Date end)
DateRange, UTC time, starting at 0:00:00.000 and ending at 23:59:59.999new Date()).start - the local start dateend - the local end dateDateRangepublic static DateRange of(long start, long end)
DateRange, starting at 0:00:00.000 and ending at 23:59:59.999start - the UTC start dateend - the UTC end dateDateRangepublic static DateRange today()
DateRange from today 0:00:00.000 to 23:59:59.999 (UTC).DateRangepublic static DateFormat newDateFormat()
DateFormat using ISO8601 pattern, but timezone agnosticDateFormatpublic final Date getStart()
public void setStart(Date date)
date - the start datepublic void setStart(long date)
date - the start datepublic Date getEnd()
public void setEnd(Date date)
date - the end datepublic void setEnd(long date)
date - the end dateCopyright © 2022 7thWeb. All rights reserved.