Class RelativeDate
- All Implemented Interfaces:
- HasHandlers
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.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic RelativeDateBuiltin option for the end of the current monthstatic RelativeDateBuiltin option for the end of today (one millisecond before theSTART_OF_TODAYstatic RelativeDateBuiltin option for the end of tomorrow (one millisecond before theSTART_OF_TOMORROW)static RelativeDateBuiltin option for the end of the current weekstatic RelativeDateBuiltin option for the end of the current yearstatic RelativeDateBuiltin option for the end of yesterday (one millisecond before theSTART_OF_YESTERDAY)static RelativeDateBuiltin option for the current day of the previous monthstatic RelativeDateBuiltin option for the current day of the following monthstatic RelativeDateBuiltin option for this moment - equivalent to callingnew RelativeDate(RelativeDateShortcut.NOW);static RelativeDateBuiltin option for this momentstatic RelativeDateBuiltin option for the start of today (same asTODAY)static RelativeDateBuiltin option for the start of tomorrow (same asTOMORROW)static RelativeDateBuiltin option for the start of the current weekstatic RelativeDateBuiltin option for the start of the current yearstatic RelativeDateBuiltin option for the start of yesterday (same asYESTERDAY)static RelativeDateBuiltin option for the start of todaystatic RelativeDateBuiltin option for the start of tomorrowstatic RelativeDateBuiltin option for the current day of the previous weekstatic RelativeDateBuiltin option for the current day of the following weekstatic RelativeDateBuiltin option for the start of yesterdayFields inherited from class com.smartgwt.client.core.DataClassfactoryCreated, factoryProperties
- 
Constructor SummaryConstructorsConstructorDescriptionRelativeDate(JavaScriptObject jsObj) RelativeDate(RelativeDateRangePosition rangePosition, String value) RelativeDate(String value) The value attribute of a RelativeDate object is a string that should be specified in one of 2 formats:
- 
Method SummaryMethods inherited from class com.smartgwt.client.core.DataClassapplyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, 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, setFactoryCreated
- 
Field Details- 
NOWBuiltin option for this moment - equivalent to callingnew RelativeDate(RelativeDateShortcut.NOW);
- 
TODAYBuiltin option for the start of today
- 
START_OF_TODAYBuiltin option for the start of today (same asTODAY)
- 
END_OF_TODAYBuiltin option for the end of today (one millisecond before theSTART_OF_TODAY
- 
YESTERDAYBuiltin option for the start of yesterday
- 
START_OF_YESTERDAYBuiltin option for the start of yesterday (same asYESTERDAY)
- 
END_OF_YESTERDAYBuiltin option for the end of yesterday (one millisecond before theSTART_OF_YESTERDAY)
- 
TOMORROWBuiltin option for the start of tomorrow
- 
START_OF_TOMORROWBuiltin option for the start of tomorrow (same asTOMORROW)
- 
END_OF_TOMORROWBuiltin option for the end of tomorrow (one millisecond before theSTART_OF_TOMORROW)
- 
WEEK_AGOBuiltin option for the current day of the previous week
- 
WEEK_FROM_NOWBuiltin option for the current day of the following week
- 
MONTH_AGOBuiltin option for the current day of the previous month
- 
MONTH_FROM_NOWBuiltin option for the current day of the following month
- 
START_OF_WEEKBuiltin option for the start of the current week
- 
END_OF_WEEKBuiltin option for the end of the current week
- 
START_OF_MONTHBuiltin option for this moment
- 
END_OF_MONTHBuiltin option for the end of the current month
- 
START_OF_YEARBuiltin option for the start of the current year
- 
END_OF_YEARBuiltin option for the end of the current year
 
- 
- 
Constructor Details- 
RelativeDateThe value attribute of a RelativeDate object is a string that should be specified in one of 2 formats:There are a number of standard preset shortcut date-offset strings. These include the following - $now - this moment
- $today - the current day. By default this resolves to the start of the current day though an explicit +link{RelativeDateRangePosition} may be used to specify the end of the current day.
- $startOfToday - the start of today
- $endOfToday - the end of today (one millisecond before the $startOfTomorrow)
- $yesterday - the previous day.
- $startOfYesterday - the start of yesterday
- $endOfYesterday - the end of yesterday (one millisecond before the $startOfToday)
- $tomorrow - the following day
- $startOfTomorrow - the start of tomorrow
- $endOfTomorrow - the end of tomorrow
- $startOfWeek - the start of the current week
- $endOfWeek - the end of the current week
- $startOfMonth - the start of the current month
- $endOfMonth - the end of the current month
- $startOfYear - the start of the current year
- $endOfYear - the end of the current year
 Alternatively the value can be a special RelativeDateString comprised of the following parts: - direction: the direction in which the quantity applies - one of + or -
- quantity: the number of units of time to apply - a number
- timeUnit: an abbreviated timeUnit to use - one of ms/MS (millisecond), s/S (second),
      mn/MN (minute), h/H (hour), d/D (day), w/W (week), m/M (month), q/Q (quarter, 3-months),
      y/Y (year), dc/DC (decade) or c/C (century). 
 The timeUnit is case sensitive. A lowercase timeUnit implies an exact offset, so+1drefers 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+1Dwould refer to the end of the day (23:39:59:999) tomorrow, and-1Dwould refer to the start of the day (00:00:00:000) yesterday.
- [qualifier]: an optional timeUnit encapsulated in square-brackets and used to offset the calculation - eg. if +1d is "plus one day", +1d[W] is "plus one day from the end of the current week". You may also specify another complete RelativeDateString as the [qualifier], which offers more control - eg, +1d[+1W] indicates "plus one day from the end of NEXT week".
 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.- Parameters:
- value- string representation of the relative date
 
- 
RelativeDate
- 
RelativeDate
 
- 
- 
Method Details- 
getRangePosition
- 
getValue- Returns:
- the string representation of the relative date
- See Also:
 
- 
getJsObj
 
-