|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.data.RelativeDate
public class RelativeDate
This class is used used to specify a datetime offset within SmartGWT, for example for use in the
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.
DateRange.setRelativeStartDate(RelativeDate),
DateRange.setRelativeEndDate(RelativeDate)| Field Summary | |
|---|---|
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 |
| Fields inherited from class com.smartgwt.client.core.JsObject |
|---|
jsObj |
| Constructor Summary | |
|---|---|
RelativeDate(JavaScriptObject jsObj)
|
|
RelativeDate(String value)
The value attribute of a RelativeDate object is a string that should be specified in one of 2 formats: |
|
| Method Summary | |
|---|---|
JavaScriptObject |
getJsObj()
|
String |
getValue()
|
| Methods inherited from class com.smartgwt.client.core.JsObject |
|---|
isCreated, setJsObj |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public RelativeDate(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(JavaScriptObject jsObj)
| Method Detail |
|---|
public String getValue()
RelativeDate(String)public JavaScriptObject getJsObj()
getJsObj in class DataClass
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||