Describable
Configs
4
Configs
4A DateHelper format string/function to use to create date output for view descriptions.
| Parameter | Type | Description |
|---|---|---|
date | Date | The date to format. |
The formatted date.
A string used to separate start and end dates in the descriptionFormat.
The date format used by the default descriptionRenderer for rendering the view's description.
If this value is null, the dateFormat (and potentially dateSeparator) will
be used.
For views that can span a range of dates, this can be a 2-item array with the following interpretation:
-
descriptionFormat[0]is either a date format string ortrue(to use dateFormat). The result of formatting thestartDatewith this format specification is used when the formatting both thestartDateandendDatewith this specification produces the same result. For example, a week view displays only the month and year components of the date, so this will be used unless the end of the week crosses into the next month. -
descriptionFormat[1]is used with formatRange when thestartDateandendDateformat differently usingdescriptionFormat[0](as described above). This one format string produces a result for both dates. If this value istrue, the dateFormat and dateSeparator are combined to produce the range format.
| Parameter | Type | Description |
|---|---|---|
date | Date | The date to format. |
The formatted date.
A function that provides the textual description for this view. If provided, this function overrides the descriptionFormat.
descriptionRenderer() {
const
eventsInView = this.eventStore.records.filter(
eventRec => DateHelper.intersectSpans(
this.startDate, this.endDate,
eventRec.startDate, eventRec.endDate)).length,
sd = DateHelper.format(this.startDate, 'DD/MM/YYY'),
ed = DateHelper.format(this.endDate, 'DD/MM/YYY');
return `${sd} - ${ed}, ${eventsInView} event${eventsInView === 1 ? '' : 's'}`;
}
| Parameter | Type | Description |
|---|---|---|
view | Widget | The active view in case the function is in another scope. |
Description string
Properties
7
Properties
7Class hierarchy
Other
A DateHelper format string/function to use to create date output for view descriptions.
| Parameter | Type | Description |
|---|---|---|
date | Date | The date to format. |
The formatted date.
A string used to separate start and end dates in the descriptionFormat.
The textual description generated by the descriptionRenderer if present, or by the view's date (or date range if it has a range) and the descriptionFormat.
The date format used by the default descriptionRenderer for rendering the view's description.
If this value is null, the dateFormat (and potentially dateSeparator) will
be used.
For views that can span a range of dates, this can be a 2-item array with the following interpretation:
-
descriptionFormat[0]is either a date format string ortrue(to use dateFormat). The result of formatting thestartDatewith this format specification is used when the formatting both thestartDateandendDatewith this specification produces the same result. For example, a week view displays only the month and year components of the date, so this will be used unless the end of the week crosses into the next month. -
descriptionFormat[1]is used with formatRange when thestartDateandendDateformat differently usingdescriptionFormat[0](as described above). This one format string produces a result for both dates. If this value istrue, the dateFormat and dateSeparator are combined to produce the range format.
| Parameter | Type | Description |
|---|---|---|
date | Date | The date to format. |
The formatted date.
Yields the default description value as calculated using the dateFormat which describes this object if no descriptionRenderer was provided.
This may be used in a configured descriptionRenderer to augment the calculated description.