Describable

Configs

4
dateFormat: String | function= MMMM d, YYYYAlso a property

A DateHelper format string/function to use to create date output for view descriptions.

ParameterTypeDescription
dateDate

The date to format.

Returns: String -

The formatted date.

A string used to separate start and end dates in the descriptionFormat.

descriptionFormat: String | String[] | Boolean[] | function | function()[]Also a property

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 or true (to use dateFormat). The result of formatting the startDate with this format specification is used when the formatting both the startDate and endDate with 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 the startDate and endDate format differently using descriptionFormat[0] (as described above). This one format string produces a result for both dates. If this value is true, the dateFormat and dateSeparator are combined to produce the range format.

ParameterTypeDescription
dateDate

The date to format.

Returns: String -

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'}`;
}
ParameterTypeDescription
viewWidget

The active view in case the function is in another scope.

Returns: String -

Description string

Properties

7

Class hierarchy

isDescribable: Boolean= truereadonly
Identifies an object as an instance of Describable class, or subclass thereof.
isDescribable: Boolean= truereadonlystatic
Identifies an object as an instance of Describable class, or subclass thereof.

Other

dateFormat: String | function= MMMM d, YYYYAlso a config

A DateHelper format string/function to use to create date output for view descriptions.

ParameterTypeDescription
dateDate

The date to format.

Returns: String -

The formatted date.

A string used to separate start and end dates in the descriptionFormat.

description: Stringreadonly

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.

descriptionFormat: String | String[] | Boolean[] | function | function()[]Also a config

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 or true (to use dateFormat). The result of formatting the startDate with this format specification is used when the formatting both the startDate and endDate with 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 the startDate and endDate format differently using descriptionFormat[0] (as described above). This one format string produces a result for both dates. If this value is true, the dateFormat and dateSeparator are combined to produce the range format.

ParameterTypeDescription
dateDate

The date to format.

Returns: String -

The formatted date.

formattedDescription: Stringreadonly

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.