public class RelativeDate extends DataClass
RelativeDateItem
class.
The value attribute is set to a string which specifies the offset from some base date (typically
the current date as returned from a call to new Date();
).
See RelativeDate(String)
for details on the expected format of the string passed in.
Modifier and Type | Field and Description |
---|---|
static RelativeDate |
END_OF_MONTH
Builtin option for the end of the current month
|
static RelativeDate |
END_OF_TODAY
Builtin option for the end of today (one millisecond before the
START_OF_TODAY |
static RelativeDate |
END_OF_TOMORROW
Builtin option for the end of tomorrow (one millisecond before the
START_OF_TOMORROW ) |
static RelativeDate |
END_OF_WEEK
Builtin option for the end of the current week
|
static RelativeDate |
END_OF_YEAR
Builtin option for the end of the current year
|
static RelativeDate |
END_OF_YESTERDAY
Builtin option for the end of yesterday (one millisecond before the
START_OF_YESTERDAY ) |
static RelativeDate |
MONTH_AGO
Builtin option for the current day of the previous month
|
static RelativeDate |
MONTH_FROM_NOW
Builtin option for the current day of the following month
|
static RelativeDate |
NOW
Builtin option for this moment - equivalent to calling
new RelativeDate(RelativeDateShortcut.NOW); |
static RelativeDate |
START_OF_MONTH
Builtin option for this moment
|
static RelativeDate |
START_OF_TODAY
Builtin option for the start of today (same as
TODAY ) |
static RelativeDate |
START_OF_TOMORROW
Builtin option for the start of tomorrow (same as
TOMORROW ) |
static RelativeDate |
START_OF_WEEK
Builtin option for the start of the current week
|
static RelativeDate |
START_OF_YEAR
Builtin option for the start of the current year
|
static RelativeDate |
START_OF_YESTERDAY
Builtin option for the start of yesterday (same as
YESTERDAY ) |
static RelativeDate |
TODAY
Builtin option for the start of today
|
static RelativeDate |
TOMORROW
Builtin option for the start of tomorrow
|
static RelativeDate |
WEEK_AGO
Builtin option for the current day of the previous week
|
static RelativeDate |
WEEK_FROM_NOW
Builtin option for the current day of the following week
|
static RelativeDate |
YESTERDAY
Builtin option for the start of yesterday
|
Constructor and Description |
---|
RelativeDate(com.google.gwt.core.client.JavaScriptObject jsObj) |
RelativeDate(RelativeDateRangePosition rangePosition,
java.lang.String value) |
RelativeDate(java.lang.String value)
The value attribute of a RelativeDate object is a string that should be specified in one of 2 formats:
|
Modifier and Type | Method and Description |
---|---|
com.google.gwt.core.client.JavaScriptObject |
getJsObj() |
RelativeDateRangePosition |
getRangePosition() |
java.lang.String |
getValue() |
doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject
public static RelativeDate NOW
new RelativeDate(RelativeDateShortcut.NOW);
public static RelativeDate TODAY
public static RelativeDate START_OF_TODAY
TODAY
)public static RelativeDate END_OF_TODAY
START_OF_TODAY
public static RelativeDate YESTERDAY
public static RelativeDate START_OF_YESTERDAY
YESTERDAY
)public static RelativeDate END_OF_YESTERDAY
START_OF_YESTERDAY
)public static RelativeDate TOMORROW
public static RelativeDate START_OF_TOMORROW
TOMORROW
)public static RelativeDate END_OF_TOMORROW
START_OF_TOMORROW
)public static RelativeDate WEEK_AGO
public static RelativeDate WEEK_FROM_NOW
public static RelativeDate MONTH_AGO
public static RelativeDate MONTH_FROM_NOW
public static RelativeDate START_OF_WEEK
public static RelativeDate END_OF_WEEK
public static RelativeDate START_OF_MONTH
public static RelativeDate END_OF_MONTH
public static RelativeDate START_OF_YEAR
public static RelativeDate END_OF_YEAR
public RelativeDate(java.lang.String value)
There are a number of standard preset shortcut date-offset strings. These include the following
Alternatively the value can be a special RelativeDateString comprised of the following parts:
+1d
refers to the current date / time increased by exactly 24 hours. If the timeUnit is
uppercase, it refers to the start or end boundary of the period of time in question, so
+1D
would refer to the end of the day (23:39:59:999) tomorrow, and
-1D
would refer to the start of the day (00:00:00:000) yesterday.
This format is very flexible. Here are a few example relative date strings:
+0D
: End of today. There are often multiple ways to represent the same time
using this system - for example this could also be written as -1ms[+1D]
-0D
: Beginning of today.
+1W
: End of next week.
+1ms[+0W]
: Beginning of next week.
+1w[-0D]
: Beginning of the current day of next week.
value
- string representation of the relative datepublic RelativeDate(RelativeDateRangePosition rangePosition, java.lang.String value)
public RelativeDate(com.google.gwt.core.client.JavaScriptObject jsObj)
public final RelativeDateRangePosition getRangePosition()
public final java.lang.String getValue()
RelativeDate(String)