Class DateRange
- java.lang.Object
-
- com.googlecode.wicket.jquery.ui.plugins.datepicker.DateRange
-
- All Implemented Interfaces:
Serializable,org.apache.wicket.util.io.IClusterable
public class DateRange extends Object implements org.apache.wicket.util.io.IClusterable
Provides the value type to be used as model object forRangeDatePickerandRangeDatePickerTextField
startandenddates are UTC based, the JSON array (toString()) is timezone agnostic- Author:
- Sebastien Briquet - sebfz1
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DategetEnd()Gets the end dateDategetStart()Gets the start datestatic DateFormatnewDateFormat()Gets a new UTCDateFormatusing ISO8601 pattern, but timezone agnosticstatic DateRangeof(long start, long end)Creates a newDateRange, starting at 0:00:00.000 and ending at 23:59:59.999
Caution: supplied dates should be UTC.static DateRangeof(Date start, Date end)Creates a newDateRange, UTC time, starting at 0:00:00.000 and ending at 23:59:59.999
Caution: supplied dates should be local to the system (ie:new Date()).voidsetEnd(long date)Sets the end date.voidsetEnd(Date date)Sets the end date.voidsetStart(long date)Sets the start date.voidsetStart(Date date)Sets the start date.static DateRangetoday()Gets a defaultDateRangefrom today 0:00:00.000 to 23:59:59.999 (UTC).StringtoString()
-
-
-
Field Detail
-
PATTERN
public static final String PATTERN
- See Also:
- Constant Field Values
-
-
Method Detail
-
of
public static DateRange of(Date start, Date end)
Creates a newDateRange, UTC time, starting at 0:00:00.000 and ending at 23:59:59.999
Caution: supplied dates should be local to the system (ie:new Date()).- Parameters:
start- the local start dateend- the local end date- Returns:
- a new
DateRange
-
of
public static DateRange of(long start, long end)
Creates a newDateRange, starting at 0:00:00.000 and ending at 23:59:59.999
Caution: supplied dates should be UTC.- Parameters:
start- the UTC start dateend- the UTC end date- Returns:
- a new
DateRange
-
today
public static DateRange today()
Gets a defaultDateRangefrom today 0:00:00.000 to 23:59:59.999 (UTC).- Returns:
- the
DateRange
-
newDateFormat
public static DateFormat newDateFormat()
Gets a new UTCDateFormatusing ISO8601 pattern, but timezone agnostic- Returns:
- a new
DateFormat
-
getStart
public final Date getStart()
Gets the start date- Returns:
- the start date
-
setStart
public void setStart(Date date)
Sets the start date.- Parameters:
date- the start date
-
setStart
public void setStart(long date)
Sets the start date.- Parameters:
date- the start date
-
getEnd
public Date getEnd()
Gets the end date- Returns:
- the end date
-
setEnd
public void setEnd(Date date)
Sets the end date.- Parameters:
date- the end date
-
setEnd
public void setEnd(long date)
Sets the end date.- Parameters:
date- the end date
-
-