Module: TimeManagerFilter

Methods

(static) timeManagerDatetimeFormat(resolution) → {string}

Return the moment.js format pattern for a Time Manager resolution.

The same patterns are used for the slider display and, once the resolution has been passed through timeManagerFilterResolution, for the layer filter expression sent to QGIS Server.

Parameters:
Name Type Description
resolution string

a Time Manager resolution: milliseconds, seconds, minutes, hours, days, weeks, months or years

Source:
Returns:

the moment.js format pattern

Type
string

(static) timeManagerFilterResolution(attributeResolution) → {string}

Return the resolution to use when formatting the layer filter expression.

The filter must keep the layer's configured resolution so that sub-day precision (minutes, hours, seconds) is preserved instead of being truncated to date-only, which returns no features for non-midnight timestamps (#7056).

The months and years resolutions are clamped to days: they would otherwise emit month-only ('2020-06') or year-only ('1928') strings, which fail for DATE-typed fields in QGIS Server expression evaluation (#6571). The full ISO date ('YYYY-MM-DD') is valid for both DATE and timestamp fields.

Parameters:
Name Type Description
attributeResolution string

the layer configured attribute resolution

Source:
Returns:

the resolution to pass to timeManagerDatetimeFormat

Type
string