|
|||||||||
| 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.core.RefDataClass
com.smartgwt.client.widgets.form.fields.FormItem
com.smartgwt.client.widgets.form.fields.CanvasItem
com.smartgwt.client.widgets.form.fields.RelativeDateItem
public class RelativeDateItem
A FormItem for entering a date relative to today or relative to some other date, or a specific date. Typically used for filtering data by date.
The RelativeDateItem consists of a ComboBoxItem where the user may directly choose one of several preset options, choose to enter a quantity and time unit (eg "4 months ago" or "3 years from now") or directly type in an
absolute date value (7/18/2009).
| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.core.JsObject |
|---|
jsObj |
| Constructor Summary | |
|---|---|
RelativeDateItem()
|
|
RelativeDateItem(JavaScriptObject jsObj)
|
|
RelativeDateItem(String name)
|
|
RelativeDateItem(String name,
String title)
|
|
| Method Summary | |
|---|---|
void |
formatEditorValue()
RelativeDateItems do not make use of the standard FormItem.formatEditorValue and FormItem.parseEditorValue methods. |
static Date |
getAbsoluteDate(RelativeDate relativeDate)
Converts a RelativeDate to a concrete Date. |
static Date |
getAbsoluteDate(RelativeDate relativeDate,
Date baseDate)
Converts a RelativeDate to a concrete Date. |
Date |
getBaseDate()
Base date for calculating the relative date entered by the user. |
int |
getCenturyThreshold()
Only used if we're showing the date in a text field. |
String |
getDaysAgoTitle()
The title to show for historical periods when the TimeUnit is "day". |
String |
getDaysFromNowTitle()
The title to show for future periods when the TimeUnit is "day". |
int |
getDefaultQuantity()
Default quantity to show in the quantityField. |
Date |
getEndDate()
Maximum date the selectors will allow the user to pick. |
void |
getEnteredValue()
Returns the raw text value typed into this items value text field |
String |
getHoursAgoTitle()
The title to show for historical periods when the TimeUnit is "hour". |
String |
getHoursFromNowTitle()
The title to show for future periods when the TimeUnit is "hour". |
String |
getInputFormat()
Format for direct user input of date values. |
String |
getMillisecondsAgoTitle()
The title to show for historical periods when the TimeUnit is "millisecond". |
String |
getMillisecondsFromNowTitle()
The title to show for future periods when the TimeUnit is "millisecond". |
String |
getMinutesAgoTitle()
The title to show for historical periods when the TimeUnit is "minute". |
String |
getMinutesFromNowTitle()
The title to show for future periods when the TimeUnit is "minute". |
String |
getMonthsAgoTitle()
The title to show for historical periods when the TimeUnit is "month". |
String |
getMonthsFromNowTitle()
The title to show for future periods when the TimeUnit is "month". |
OperatorId |
getOperator()
What operator to use when RelativeDateItem.getCriterion is called. |
static RelativeDateItem |
getOrCreateRef(JavaScriptObject jsObj)
|
String |
getPickerConstructor()
Smart GWT class for the dateChooser autoChild
displayed to allow the user to directly select dates. |
String |
getPickerIconPrompt()
Prompt to show when the user hovers the mouse over the picker icon for this RelativeDateItem. |
RelativeDateRangePosition |
getRangePosition()
Does this items relative date value refer to the start or end of the chosen date? Useful when using this item to generate filter criteria, such as the from or to value for an inclusive range. |
RelativeDate |
getRelativeDate()
Returns the RelativeDate for the current value. |
String |
getSecondsAgoTitle()
The title to show for historical periods when the TimeUnit is "second". |
String |
getSecondsFromNowTitle()
The title to show for future periods when the TimeUnit is "second". |
Boolean |
getShowCalculatedDateField()
Should the Calculated-Date be displayed to the right of the pickerIcon. |
Boolean |
getShowChooserIcon()
Should we show the icon that shells a date-chooser? |
Boolean |
getShowFutureOptions()
Should we show time-unit options in the future? If set to false, for each timeUnitOption we will show only past
options [for example "N weeks ago"]. |
Boolean |
getShowPastOptions()
Should we show time-unit options in the past? If set to false, for each timeUnitOption we will show only future
options [for example "N weeks from now"]. |
Date |
getStartDate()
Minimum date the selectors will allow the user to pick. |
TimeUnit[] |
getTimeUnitOptions()
List of time units that will be offered for relative dates. |
Boolean |
getUseSharedPicker()
When set to true (the default), use a single shared date-picker across all widgets that use one. |
String |
getWeeksAgoTitle()
The title to show for historical periods when the TimeUnit is "week". |
String |
getWeeksFromNowTitle()
The title to show for future periods when the TimeUnit is "week". |
String |
getYearsAgoTitle()
The title to show for historical periods when the TimeUnit is "year". |
String |
getYearsFromNowTitle()
The title to show for future periods when the TimeUnit is "year". |
void |
parseEditorValue()
RelativeDateItems do not make use of the standard FormItem.formatEditorValue and FormItem.parseEditorValue methods. |
void |
setBaseDate(Date baseDate)
Base date for calculating the relative date entered by the user. |
void |
setCenturyThreshold(int centuryThreshold)
Only used if we're showing the date in a text field. |
void |
setDateFormatter(DateDisplayFormat dateFormatter)
Format for displaying dates in the valueField and calculatedDateField. |
void |
setDateFormatter(DateDisplayFormatter formatter)
Formatter function for displaying dates in the valueField and calculatedDateField in some custom format. |
void |
setDateParser(DateParser parser)
Custom date parser function for direct user input of date values. |
void |
setDaysAgoTitle(String daysAgoTitle)
The title to show for historical periods when the TimeUnit is "day". |
void |
setDaysFromNowTitle(String daysFromNowTitle)
The title to show for future periods when the TimeUnit is "day". |
void |
setDefaultQuantity(int defaultQuantity)
Default quantity to show in the quantityField. |
void |
setEditorValueFormatter(FormItemValueFormatter formatter)
RelativeDateItems do not make use of the standard FormItem.setEditorValueFormatter() and FormItem.setEditorValueParser() methods. |
void |
setEditorValueParser(FormItemValueParser parser)
RelativeDateItems do not make use of the standard FormItem.setEditorValueFormatter() and FormItem.setEditorValueParser() methods. |
void |
setEndDate(Date endDate)
Maximum date the selectors will allow the user to pick. |
void |
setHoursAgoTitle(String hoursAgoTitle)
The title to show for historical periods when the TimeUnit is "hour". |
void |
setHoursFromNowTitle(String hoursFromNowTitle)
The title to show for future periods when the TimeUnit is "hour". |
void |
setInputFormat(String inputFormat)
Format for direct user input of date values. |
void |
setMillisecondsAgoTitle(String millisecondsAgoTitle)
The title to show for historical periods when the TimeUnit is "millisecond". |
void |
setMillisecondsFromNowTitle(String millisecondsFromNowTitle)
The title to show for future periods when the TimeUnit is "millisecond". |
void |
setMinutesAgoTitle(String minutesAgoTitle)
The title to show for historical periods when the TimeUnit is "minute". |
void |
setMinutesFromNowTitle(String minutesFromNowTitle)
The title to show for future periods when the TimeUnit is "minute". |
void |
setMonthsAgoTitle(String monthsAgoTitle)
The title to show for historical periods when the TimeUnit is "month". |
void |
setMonthsFromNowTitle(String monthsFromNowTitle)
The title to show for future periods when the TimeUnit is "month". |
void |
setOperator(OperatorId operator)
What operator to use when RelativeDateItem.getCriterion is called. |
void |
setPickerConstructor(String pickerConstructor)
Smart GWT class for the dateChooser autoChild
displayed to allow the user to directly select dates. |
void |
setPickerIconPrompt(String pickerIconPrompt)
Prompt to show when the user hovers the mouse over the picker icon for this RelativeDateItem. |
void |
setPresetOptions(LinkedHashMap valueMap)
Set up a set of standard relative dates such as "today" or "tomorrow" that the user can choose directly from the valueField of this item. |
void |
setRangePosition(RelativeDateRangePosition rangePosition)
Does this items relative date value refer to the start or end of the chosen date? Useful when using this item to generate filter criteria, such as the from or to value for an inclusive range. |
void |
setRangeRoundingGranularity(Map rangeRoundingGranularity)
A map from a granularity of time specified by a user to the granularity of time used for rounding. |
void |
setSecondsAgoTitle(String secondsAgoTitle)
The title to show for historical periods when the TimeUnit is "second". |
void |
setSecondsFromNowTitle(String secondsFromNowTitle)
The title to show for future periods when the TimeUnit is "second". |
void |
setShowCalculatedDateField(Boolean showCalculatedDateField)
Should the Calculated-Date be displayed to the right of the pickerIcon. |
void |
setShowChooserIcon(Boolean showChooserIcon)
Should we show the icon that shells a date-chooser? |
void |
setShowFutureOptions(Boolean showFutureOptions)
Should we show time-unit options in the future? If set to false, for each timeUnitOption we will show only past
options [for example "N weeks ago"]. |
void |
setShowPastOptions(Boolean showPastOptions)
Should we show time-unit options in the past? If set to false, for each timeUnitOption we will show only future
options [for example "N weeks from now"]. |
void |
setStartDate(Date startDate)
Minimum date the selectors will allow the user to pick. |
void |
setTimeUnitOptions(TimeUnit... timeUnitOptions)
List of time units that will be offered for relative dates. |
void |
setUseSharedPicker(Boolean useSharedPicker)
When set to true (the default), use a single shared date-picker across all widgets that use one. |
void |
setWeeksAgoTitle(String weeksAgoTitle)
The title to show for historical periods when the TimeUnit is "week". |
void |
setWeeksFromNowTitle(String weeksFromNowTitle)
The title to show for future periods when the TimeUnit is "week". |
void |
setYearsAgoTitle(String yearsAgoTitle)
The title to show for historical periods when the TimeUnit is "year". |
void |
setYearsFromNowTitle(String yearsFromNowTitle)
The title to show for future periods when the TimeUnit is "year". |
| Methods inherited from class com.smartgwt.client.widgets.form.fields.CanvasItem |
|---|
addShowValueHandler, canEditCriterion, createCanvas, getApplyPromptToCanvas, getCanvas, getCriterion, getEditCriteriaInInnerForm, getOverflow, getPrompt, getShouldSaveValue, hasAdvancedCriteria, setApplyPromptToCanvas, setCanvas, setCriterion, setEditCriteriaInInnerForm, setOverflow, setPrompt, setShouldSaveValue, setupCanvasConstructor, storeValue, storeValue, storeValue |
| Methods inherited from class com.smartgwt.client.core.RefDataClass |
|---|
getRef, getRef |
| Methods inherited from class com.smartgwt.client.core.DataClass |
|---|
doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute |
| Methods inherited from class com.smartgwt.client.core.JsObject |
|---|
setJsObj |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public RelativeDateItem()
public RelativeDateItem(JavaScriptObject jsObj)
public RelativeDateItem(String name)
public RelativeDateItem(String name,
String title)
| Method Detail |
|---|
public static RelativeDateItem getOrCreateRef(JavaScriptObject jsObj)
public void setBaseDate(Date baseDate)
The default is to use the current date.
baseDate - baseDate Default value is nullpublic Date getBaseDate()
The default is to use the current date.
public void setCenturyThreshold(int centuryThreshold)
centuryThreshold - centuryThreshold Default value is 25Appearance overview and related methodspublic int getCenturyThreshold()
Appearance overview and related methodspublic void setDaysAgoTitle(String daysAgoTitle)
TimeUnit is "day".
daysAgoTitle - daysAgoTitle Default value is "N days ago"public String getDaysAgoTitle()
TimeUnit is "day".
public void setDaysFromNowTitle(String daysFromNowTitle)
TimeUnit is "day".
daysFromNowTitle - daysFromNowTitle Default value is "N days from now"public String getDaysFromNowTitle()
TimeUnit is "day".
public void setDefaultQuantity(int defaultQuantity)
quantityField.
defaultQuantity - defaultQuantity Default value is 1public int getDefaultQuantity()
quantityField.
public void setEndDate(Date endDate)
See startDate for details on how this restriction works.
endDate - endDate Default value is 12/31/2015Appearance overview and related methodspublic Date getEndDate()
See startDate for details on how this restriction works.
Appearance overview and related methodspublic void setHoursAgoTitle(String hoursAgoTitle)
TimeUnit is "hour".
hoursAgoTitle - hoursAgoTitle Default value is "N hours ago"public String getHoursAgoTitle()
TimeUnit is "hour".
public void setHoursFromNowTitle(String hoursFromNowTitle)
TimeUnit is "hour".
hoursFromNowTitle - hoursFromNowTitle Default value is "N hours from now"public String getHoursFromNowTitle()
TimeUnit is "hour".
public void setInputFormat(String inputFormat)
If unset, the input format will be determined based on the specified
displayFormat if possible, otherwise
picked up from the Date class (see Date.setInputFormat).
setInputFormat in class FormIteminputFormat - inputFormat Default value is nullFormItem.setDateFormatter(com.smartgwt.client.types.DateDisplayFormat)public String getInputFormat()
If unset, the input format will be determined based on the specified
displayFormat if possible, otherwise
picked up from the Date class (see Date.setInputFormat).
getInputFormat in class FormItemuseTextField is true this
method returns a standard String, determining how values entered by the user are to be converted to Javascript Date
objects. If an explicit inputFormat has been
specified it will be returned, otherwise, the input format will be automatically derived from the dateFormatter property.
Note that the inputFormat
will ignore any separator characters and padding of values. However if necessary entirely custom date formatting and
parsing may be achieved via the setEditorValueFormatter() and setEditorValueParser() APIs.
FormItem.getDateFormatter()public void setMillisecondsAgoTitle(String millisecondsAgoTitle)
TimeUnit is "millisecond".
millisecondsAgoTitle - millisecondsAgoTitle Default value is "N milliseconds ago"public String getMillisecondsAgoTitle()
TimeUnit is "millisecond".
public void setMillisecondsFromNowTitle(String millisecondsFromNowTitle)
TimeUnit is "millisecond".
millisecondsFromNowTitle - millisecondsFromNowTitle Default value is "N milliseconds from now"public String getMillisecondsFromNowTitle()
TimeUnit is "millisecond".
public void setMinutesAgoTitle(String minutesAgoTitle)
TimeUnit is "minute".
minutesAgoTitle - minutesAgoTitle Default value is "N minutes ago"public String getMinutesAgoTitle()
TimeUnit is "minute".
public void setMinutesFromNowTitle(String minutesFromNowTitle)
TimeUnit is "minute".
minutesFromNowTitle - minutesFromNowTitle Default value is "N minutes from now"public String getMinutesFromNowTitle()
TimeUnit is "minute".
public void setMonthsAgoTitle(String monthsAgoTitle)
TimeUnit is "month".
monthsAgoTitle - monthsAgoTitle Default value is "N months ago"public String getMonthsAgoTitle()
TimeUnit is "month".
public void setMonthsFromNowTitle(String monthsFromNowTitle)
TimeUnit is "month".
monthsFromNowTitle - monthsFromNowTitle Default value is "N months from now"public String getMonthsFromNowTitle()
TimeUnit is "month".
public void setOperator(OperatorId operator)
RelativeDateItem.getCriterion is called.
setOperator in class FormItemoperator - operator Default value is "greaterThan"CriteriaEditing overview and related methodspublic OperatorId getOperator()
RelativeDateItem.getCriterion is called.
getOperator in class FormItemCriteriaEditing overview and related methodspublic void setPickerConstructor(String pickerConstructor)
dateChooser autoChild
displayed to allow the user to directly select dates.
pickerConstructor - pickerConstructor Default value is "DateChooser"public String getPickerConstructor()
dateChooser autoChild
displayed to allow the user to directly select dates.
public void setPickerIconPrompt(String pickerIconPrompt)
pickerIconPrompt - pickerIconPrompt Default value is "Show Date Chooser"public String getPickerIconPrompt()
public void setRangePosition(RelativeDateRangePosition rangePosition)
If unset "start" is assumed.
Note : This is an advanced setting
rangePosition - rangePosition Default value is nullsetOperator(com.smartgwt.client.types.OperatorId),
setRangeRoundingGranularity(java.util.Map)public RelativeDateRangePosition getRangePosition()
If unset "start" is assumed.
getOperator(),
com.smartgwt.client.widgets.form.fields.RelativeDateItem#getRangeRoundingGranularitypublic void setSecondsAgoTitle(String secondsAgoTitle)
TimeUnit is "second".
secondsAgoTitle - secondsAgoTitle Default value is "N seconds ago"public String getSecondsAgoTitle()
TimeUnit is "second".
public void setSecondsFromNowTitle(String secondsFromNowTitle)
TimeUnit is "second".
secondsFromNowTitle - secondsFromNowTitle Default value is "N seconds from now"public String getSecondsFromNowTitle()
TimeUnit is "second".
public void setShowCalculatedDateField(Boolean showCalculatedDateField)
pickerIcon.
showCalculatedDateField - showCalculatedDateField Default value is truepublic Boolean getShowCalculatedDateField()
pickerIcon.
public void setShowChooserIcon(Boolean showChooserIcon)
showChooserIcon - showChooserIcon Default value is truepublic Boolean getShowChooserIcon()
public void setShowFutureOptions(Boolean showFutureOptions)
timeUnitOption we will show only past
options [for example "N weeks ago"]. Note: this does not change the presetOptions, which show up in addition to
the time-unit options ("N days from now", etc). The default preset options include both past and future presets
so developers may wish to modify the presets to ensure only future options are available.
showFutureOptions - showFutureOptions Default value is truepublic Boolean getShowFutureOptions()
timeUnitOption we will show only past
options [for example "N weeks ago"]. Note: this does not change the presetOptions, which show up in addition to
the time-unit options ("N days from now", etc). The default preset options include both past and future presets
so developers may wish to modify the presets to ensure only future options are available.
public void setShowPastOptions(Boolean showPastOptions)
timeUnitOption we will show only future
options [for example "N weeks from now"]. Note: this does not change the presetOptions, which show up in addition to
the time-unit options ("N days from now", etc). The default preset options include both past and future presets
so developers may wish to modify the presets to ensure only past options are available.
showPastOptions - showPastOptions Default value is truepublic Boolean getShowPastOptions()
timeUnitOption we will show only future
options [for example "N weeks from now"]. Note: this does not change the presetOptions, which show up in addition to
the time-unit options ("N days from now", etc). The default preset options include both past and future presets
so developers may wish to modify the presets to ensure only past options are available.
public void setStartDate(Date startDate)
NOTE: by design, setting startDate and
endDate will not always prevent the user from picking invalid values. In particular:
This is by design as it allows the user to set the day, month and year in whatever order is convenient, rather than forcing them to pick in a specific order.
For actual enforcement of a date being in correct range before data is submitted, a Validator of type "dateRange" should always be declared.
startDate - startDate Default value is 1/1/1995Appearance overview and related methodspublic Date getStartDate()
NOTE: by design, setting startDate and
endDate will not always prevent the user from picking invalid values. In particular:
This is by design as it allows the user to set the day, month and year in whatever order is convenient, rather than forcing them to pick in a specific order.
For actual enforcement of a date being in correct range before data is submitted, a Validator of type "dateRange" should always be declared.
Appearance overview and related methodspublic void setTimeUnitOptions(TimeUnit... timeUnitOptions)
Each available time unit option will cause two options
to appear in the valueField. For
example, if "day" is an available time unit option, there will be "N days ago" and "N days from now".
timeUnitOptions - timeUnitOptions Default value is ["day", "week", "month"]setShowPastOptions(java.lang.Boolean),
setShowFutureOptions(java.lang.Boolean),
setRangeRoundingGranularity(java.util.Map)public TimeUnit[] getTimeUnitOptions()
Each available time unit option will cause two options
to appear in the valueField. For
example, if "day" is an available time unit option, there will be "N days ago" and "N days from now".
getShowPastOptions(),
getShowFutureOptions(),
com.smartgwt.client.widgets.form.fields.RelativeDateItem#getRangeRoundingGranularitypublic void setUseSharedPicker(Boolean useSharedPicker)
picker and pickerProperties for details
on setting up an unshared picker.
useSharedPicker - useSharedPicker Default value is truepublic Boolean getUseSharedPicker()
picker and pickerProperties for details
on setting up an unshared picker.
public void setWeeksAgoTitle(String weeksAgoTitle)
TimeUnit is "week".
weeksAgoTitle - weeksAgoTitle Default value is "N weeks ago"public String getWeeksAgoTitle()
TimeUnit is "week".
public void setWeeksFromNowTitle(String weeksFromNowTitle)
TimeUnit is "week".
weeksFromNowTitle - weeksFromNowTitle Default value is "N weeks from now"public String getWeeksFromNowTitle()
TimeUnit is "week".
public void setYearsAgoTitle(String yearsAgoTitle)
TimeUnit is "year".
yearsAgoTitle - yearsAgoTitle Default value is "N years ago"public String getYearsAgoTitle()
TimeUnit is "year".
public void setYearsFromNowTitle(String yearsFromNowTitle)
TimeUnit is "year".
yearsFromNowTitle - yearsFromNowTitle Default value is "N years from now"public String getYearsFromNowTitle()
TimeUnit is "year".
public void formatEditorValue()
FormItem.formatEditorValue and FormItem.parseEditorValue methods. Developers can
customize the display values for these items in the following ways:presetOptions map allows standard preset
RelativeDateString and RelativeDateShortcut values to be mapped to custom display valuestimeUnitOptions (e.g:"N days ago") may be customized via the per-time unit title attributes (daysFromNowTitle, daysAgoTitle, etc)dateFormatter and inputFormat may be used modify how date values
are displayed (both in the text entry box and in the calculatedDateField
public void getEnteredValue()
public void parseEditorValue()
FormItem.formatEditorValue and FormItem.parseEditorValue methods. Developers can
customize the display values for these items in the following ways:presetOptions map allows standard preset
RelativeDateString and RelativeDateShortcut values to be mapped to custom display valuestimeUnitOptions (e.g:"N days ago") may be customized via the per-time unit title attributes (daysFromNowTitle, daysAgoTitle, etc)dateFormatter and inputFormat may be used modify how date values
are displayed (both in the text entry box and in the calculatedDateField
public RelativeDate getRelativeDate()
public static Date getAbsoluteDate(RelativeDate relativeDate)
relativeDate - the relative date to convert
public static Date getAbsoluteDate(RelativeDate relativeDate,
Date baseDate)
relativeDate - the relative date to convertbaseDate - base value for conversion. Defaults to today
public void setPresetOptions(LinkedHashMap valueMap)
This is similar to a standard FormItem::setValueMap(), valueMap - the parameter passed in should be
a HashMap mapping RelativeDate strings to display values.
The default set of preset options (expressed in JSON) are:
{
"$today" : "Today",
"$yesterday" : "Yesterday",
"$tomorrow" : "Tomorrow",
"-1w" : "Current day of last week",
"+1w" : "Current day of next week",
"-1m" : "Current day of last month",
"+1m" : "Current day of next month"
}
In addition to these presets, options are shown for each of the #setTimeUnitOptions,time unit options.
- public void setRangeRoundingGranularity(Map rangeRoundingGranularity)
A relative date such as "n days from now" is normally shifted to the end of the day when used as a range endpoint, and the beginning of the day when used as the beginning of a range. (The rounding direction on some item can be specified via +link{relativeDateItem.rangePosition}). This causes the intuitive behavior that "from yesterday to today" is from the beginning of yesterday to the end of today, and that "from today until 5 days from now" includes the entirety of Friday if today is Monday.
This same rule can be applied to any time granularity, such that "from now until 20 minutes from now" is up to 5:32 if it is now 5:11:34, and "from now until 2 months from now" means end of June if it is mid-April.
User intuitions about where this rounding is expected for any given time period tend to vary based on what kind of event is being discussed and subtle phrasing differences (consider "up to one year from now", "until next year", "within the next couple of years"). The defaults behaviors are:
RelativeDateItem fromDate = new RelativeDateItem("from");
fromDate.setRangePosition(RelativeDateRangePosition.START);
fromDate.setTimeUnitOptions(TimeUnit.DAY, TimeUnit.WEEK);
Map roundingMap = new HashMap();
roundingMap.put(TimeUnit.DAY, TimeUnit.DAY);
roundingMap.put(TimeUnit.WEEK, TimeUnit.WEEK);
fromDate.setRangeRoundingGranularity(roundingMap);
rangeRoundingGranularity - public void setDateFormatter(DateDisplayFormat dateFormatter)
valueField and calculatedDateField. Defaults to the system-wide default established by Date.setShortDisplayFormat, or if this item
has its type specified as datetime, Date.setShortDatetimeDisplayFormat.
setDateFormatter in class FormItemdateFormatter - dateFormatter Default value is nullFormItem.setTimeFormatter(com.smartgwt.client.types.TimeDisplayFormat),
Appearance overview and related methodspublic void setDateFormatter(DateDisplayFormatter formatter)
valueField and calculatedDateField in some custom format. Typically the setDateParser(DateParser) method should
also be applied to ensure dates can be both formatted and edited date strings parsed back into actual
date values.
dateFormatter - dateFormatter Default value is nullpublic void setDateParser(DateParser parser)
setDateFormatter(DateDisplayFormatter).
Note that setDateFormatter(DateDisplayFormat) and
setInputFormat(String) already
provide a mechanism for customizing the display format for date values displayed in this item.
public void setEditorValueParser(FormItemValueParser parser)
setEditorValueParser in class FormItemparser - the FormItemValueParserpublic void setEditorValueFormatter(FormItemValueFormatter formatter)
setEditorValueFormatter in class FormItemformatter - the FormItemValueFormatter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||