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 forRangeDatePicker
andRangeDatePickerTextField
start
andend
dates 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 Date
getEnd()
Gets the end dateDate
getStart()
Gets the start datestatic DateFormat
newDateFormat()
Gets a new UTCDateFormat
using ISO8601 pattern, but timezone agnosticstatic 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.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()
).void
setEnd(long date)
Sets the end date.void
setEnd(Date date)
Sets the end date.void
setStart(long date)
Sets the start date.void
setStart(Date date)
Sets the start date.static DateRange
today()
Gets a defaultDateRange
from today 0:00:00.000 to 23:59:59.999 (UTC).String
toString()
-
-
-
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 defaultDateRange
from today 0:00:00.000 to 23:59:59.999 (UTC).- Returns:
- the
DateRange
-
newDateFormat
public static DateFormat newDateFormat()
Gets a new UTCDateFormat
using 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
-
-