AbstractStatic ReadonlyAPPROXIMATE_Approximate number of milliseconds in one month (estimation, not considering months of 28, 29 or 31 days).
Static ReadonlyAPPROXIMATE_The milliseconds for 1 year (estimation, not considering leap years).
StaticDEFAULT_The default date format for English and French to be used by the application.
StaticDEFAULT_The default year-only format for English and French to be used by the application.
StaticDEFAULT_The default date and time format for English and French to be used by the application.
StaticDEFAULT_The default temporal mode to be used by the application.
StaticDEFAULT_The default time format for English and French to be used by the application.
Static ReadonlyISO_The international ISO date format.
Static ReadonlyISO_The international ISO datetime format.
Static ReadonlyISO_The international ISO format without the seconds.
Static ReadonlyISO_The international ISO format without the milliseconds.
Static ReadonlyISO_The display format for international ISO date only for English and French.
Static ReadonlyISO_A default datetime format for English and French.
Static ReadonlyISO_A default time-only format for English and French.
Static ReadonlyISO_A default year-only format for English and French.
Static ReadonlyISO_The international ISO time format with seconds.
Static ReadonlyISO_The international ISO time format.
Static ReadonlyLONG_The Long date format.
Static ReadonlyLONG_The Long datetime format.
Static ReadonlyMILLISECONDS_The milliseconds for 1 day.
Static ReadonlyMILLISECONDS_Number of milliseconds in one hour.
Static ReadonlyMILLISECONDS_Number of milliseconds in one week.
Static ReadonlyREGEX_Regular expression for matching ISO date strings.
Static ReadonlyREGEX_Regular expression for matching ISO date strings with a 'date' prefix.
Static ReadonlyTIME_Static constant indicating the local IANA time zone.
Static ReadonlyTIME_Static constant to indicate when we interpret a date as UTC. For general purposes of UTC.
StaticaddAdvances a timestamp by one calendar step without converting months or years to fixed durations.
The timestamp to advance
The calendar unit to apply
The number and direction of calendar units to advance
The advanced timestamp
StaticconvertConvert a date to milliseconds.
The date to use
OptionalinputFormat: string | string[]
Optional, one or more format strings to prioritize when parsing string inputs
OptionalinputTimezone: string
Optional timezone to assume for string inputs that do not explicitly include a timezone
Date as milliseconds
StaticcreateCreates a native Date object from a DateLike input.
This is a convenience wrapper around createDayjs that converts the validated
Dayjs instance into a native JavaScript Date.
Parsing, validation, and temporal logic are delegated to createDayjs.
The returned Date represents the same instant in time as the underlying Dayjs object.
The input date to convert. Can be:
Date objectOptionalinputFormat: string | string[]
Optional format(s) for parsing string inputs. Passed directly to createDayjs
OptionalinputTimezone: string
Optional IANA timezone to apply if the input string has no explicit timezone and is parsed as an instant
OptionaltemporalMode: TemporalMode
Optional, determines how string inputs are interpreted:
"calendar": parsed as a calendar date"instant": parsed as an exact point in timeDEFAULT_TEMPORAL_MODEA native JavaScript Date object representing the parsed date
StaticcreateCreates a validated Dayjs instance from a DateLike input.
This is a thin wrapper around parseDateToDayjs that ensures the resulting
Dayjs object is valid, throwing an error if parsing fails.
This method guarantees that the returned Dayjs instance is valid.
All parsing rules, timezone handling, and temporal logic are delegated to parseDateToDayjs.
The input date to parse. Can be:
Date objectOptionalinputFormat: string | string[]
Optional format(s) for parsing string inputs.
Passed directly to parseDateToDayjs
OptionalinputTimezone: string
Optional IANA timezone to apply if the input string has no explicit timezone and is parsed as an instant
OptionaltemporalMode: TemporalMode
Optional, determines how string inputs are interpreted:
"calendar": parsed as a calendar date"instant": parsed as an exact point in timeDEFAULT_TEMPORAL_MODEA valid Dayjs object representing the parsed date
StaticcreateCreate the Geoview time dimension from ESRI dimension.
Esri time dimension object
Optional display date mode
Optional, true if it is ESRI Image
The Geoview time dimension
StaticcreateCreates a normalized GeoView time-dimension model from an OGC WMS time dimension.
The method parses the raw OGC values with DateMgt.createRangeOGC, infers display formatting from the resulting range, and resolves the initial slider defaults from the service metadata. When the dimension belongs to a QGIS group, a synthetic default is injected so the control still behaves as a valid single-value selection even if the service omits a default.
The OGC dimension object or its JSON string representation from the WMS capability document
Optional display date mode used to infer the presentation format
Optional flag indicating whether this dimension belongs to a grouped layer definition
The normalized GeoView time dimension, including parsed range metadata and default selection values
StaticcreateCreates a normalized range model for an OGC time dimension value.
This method resolves the current or present keyword before classifying the value, normalizes whitespace,
and returns a structured RangeItems object whose type is one of discrete, relative,
or none. Discrete values are split into a list of ISO strings, while relative and absolute
intervals are expanded into bounded UTC start/end values with an optional duration payload.
Supported shapes include comma-separated discrete dates, relative intervals such as
start/end or start/duration, and absolute intervals such as start/end/period.
The raw OGC time dimension value from a WMS capability document
The normalized range metadata for the dimension, including the parsed type, range, and optional durationInterval
StaticfindFinds the timestamp in a range nearest to the requested value.
The timestamp values to search
The target timestamp
The timestamp with the smallest absolute difference from the target
StaticformatFormats a DateLike value into a string using the specified format, locale,
timezone, and temporal interpretation.
This method first normalizes the input using parseDateToDayjs, then applies
output-specific transformations such as timezone conversion, locale, and formatting.
The input is always parsed via parseDateToDayjs, ensuring consistent handling of Date,
epoch, and string values. Calendar dates are normalized to local midnight and are not
shifted to outputTimezone. Instant dates are converted to outputTimezone before formatting.
The locale is applied after parsing and timezone adjustments.
The input date to format. Can be:
Date objectOptional, the Dayjs format string used to produce the output
Optional locale used for formatting (e.g. month and weekday names)
Optional IANA timezone applied to the output when formatting instant dates
Optional, determines how the input is interpreted:
"calendar": treated as a whole calendar day"instant": treated as an exact point in timeOptionalinputFormat: string | string[]
Optional format(s) for parsing string inputs.
If provided, these are passed through to parseDateToDayjs
OptionalinputTimezone: string
Optional IANA timezone to apply if the input string has no explicit timezone and is parsed as an instant
Optional, whether to append a literal 'Z' to the formatted output string
The formatted date string
StaticformatFormats a date into a short ISO-like string (YYYY-MM-DDTHH:mm:ss).
This is a convenience wrapper around formatDate that produces a compact,
timezone-aware ISO-style representation, optionally appending a Z suffix
when formatted in UTC.
Uses the format YYYY-MM-DDTHH:mm:ss. Delegates all parsing and formatting logic to formatDate.
Appends a literal 'Z' to the output only when outputTimezone is UTC.
Calendar dates are not shifted by outputTimezone.
The input date to format. Can be:
Date objectOptional IANA timezone applied to the output when formatting instant dates
OptionaltemporalMode: TemporalMode
Optional, determines how the input is interpreted:
"calendar": treated as a calendar date"instant": treated as an exact point in timeOptionalinputFormat: string | string[]
Optional format(s) for parsing string inputs. Passed through to formatDate
Optional IANA timezone to apply if the input string has no explicit timezone and is parsed as an instant
A short ISO-like formatted date string
StaticformatFormats a single date or a date range according to the specified display format, language, timezone, and temporal mode.
If a second date is provided, the function returns a string representing the range in the format "date1 / date2".
The first date (or the only date) to format
Object containing the display format for each language
Language code to select the correct format from dateFormat
OptionaloutputTimezone: string
Optional IANA timezone to use for output formatting
OptionalinputTemporalMode: TemporalMode
Optional, whether to interpret the input as 'calendar' or 'instant'
Optionaldate2: DateLike
Optional second date for formatting a date range
A formatted date string or a formatted date range string
StaticformatFormats a single date or a date range according to the specified display format, language, timezone, and temporal mode.
If a second date is provided, the function returns a string representing the range in the format "date1 / date2".
The first date (or the only date) to format
OptionalinputTemporalMode: TemporalMode
Optional, whether to interpret the input as 'calendar' or 'instant'
Optionaldate2: DateLike
Optional second date for formatting a date range
A formatted date string or a formatted date range string
StaticgetReturns an approximate numeric step used to estimate nearby calendar-step candidates.
The calendar unit to approximate
The approximate duration in milliseconds
StaticgetGets the default date and datetime formats based on the display date mode.
The display date mode, e.g., 'long' or undefined for default
The default date and datetime formats for the given mode
StaticguessAttempts to infer display date configuration from a service-provided date format string.
The function inspects the format string to determine whether it contains time-related components (e.g., hours, minutes, seconds, timezone tokens). If time components are detected, it assumes:
undefined is returned.
This function performs heuristic inference and may not be accurate for all custom
or non-standard format strings. Errors during evaluation are logged and do not propagate.The date format string provided by the service
(e.g., "YYYY-MM-DDTHH:mm:ss")
A partial GuessedTimeInformation object containing inferred
display settings if time components are detected; otherwise undefined
StaticguessAttempts to infer display date configuration from a service time dimension.
This function analyzes an array of date values and applies heuristics based on the overall time span and time-of-day consistency to determine:
instant or calendar values.local.instant.undefined.All comparisons are performed in UTC. This function relies on heuristics and may not be correct for all datasets. Errors during parsing are logged and do not propagate.
Array of service-provided date values to analyze
A partially populated GuessedTimeInformation object
if a confident inference can be made; otherwise undefined
StaticguessGuesses the estimated steps that should be used by the slider, depending on the value range.
The minimum value
The maximum value
The estimated stepping value based on the min and max values, or undefined
StaticguessGuesses a calendar unit for continuous time-slider playback.
The minimum timestamp value
The maximum timestamp value
The estimated calendar unit, or undefined when no calendar unit is appropriate
StatichasDetermines whether a date/time format string contains any supported time-related tokens.
The method performs a simple substring check against a predefined
list of time tokens (e.g. hours, minutes, seconds, meridiem, Unix time).
If the format is undefined, the method safely returns false.
The date/time format string to evaluate. May be undefined
true if the format contains at least one recognized time token;
otherwise false
StaticisChecks whether an OGC time dimension is an absolute start/end/interval range.
The OGC time dimension value to check
Whether the value represents an absolute range
StaticisChecks whether an OGC time dimension contains comma-separated discrete values.
The OGC time dimension value to check
Whether the value represents a discrete range
StaticisChecks whether an OGC time dimension contains one discrete value.
The OGC time dimension value to check
Whether the value represents one discrete value
StaticisChecks whether an OGC time dimension is a relative two-part range.
The OGC time dimension value to check
Whether the value represents a relative range
StaticisChecks whether a given IANA time zone is supported by the runtime.
Validation is performed using Day.js with the timezone plugin, which relies
on the underlying Intl time zone database.
IANA time zone identifier to check
true if the time zone is valid and supported, otherwise false
StaticparseParses a date string as a calendar date, ignoring any timezone or offset semantics and preserving the civil date and time fields as-is.
This function interprets the input purely in terms of its calendar components (year, month, day, and optional time), then normalizes those components by re-anchoring them in UTC. No timezone conversion is applied. This guarantees that calendar-based dates do not shift days due to timezone offsets, DST, or environment locale.
Date string to parse
OptionalinputFormat: string | string[]
Optional format or list of formats used to parse the input date string
Optional, whether to enforce strict parsing when using custom formats
Dayjs instance normalized to UTC using calendar semantics
StaticparseParses a DateLike input into a Dayjs object, automatically handling different types
of input and temporal modes.
Supports:
Date objects (treated as exact UTC instants)If date is a number or Date, it is parsed as a UTC instant. If date is a string
containing a timezone, it is treated as an "instant" date. If inputTemporalMode is
"calendar", the string is parsed with parseCalendarDate and normalized to local midnight.
Otherwise, the string is parsed as an instant using parseInstantDate.
The input date. Can be:
Date objectOptionalinputFormat: string | string[]
Optional format(s) for parsing string inputs. If provided, Dayjs will use these formats instead of auto-detection
OptionalinputTimezone: string
Optional IANA timezone to apply if the input string
does not have an explicit timezone. Defaults to TIME_UTC in parseInstantDate
Determines how string inputs are interpreted:
"instant": exact point in time"calendar": normalized to midnight local timeOptional, if true, enforces strict parsing according to the
provided inputFormat
A Dayjs object representing the parsed date
StaticparseParses a string as an "instant" point in time into a Dayjs object.
Handles:
If the input string contains a timezone (hasTZ is true), it is treated as an exact instant.
If the input string lacks a timezone, inputTimezone is applied.
The input date string to parse
OptionalinputFormat: string | string[]
Optional format(s) for parsing. If provided, Dayjs will use these formats instead of auto-detection
Optional IANA timezone string to apply if the input string has no explicit timezone
Optional, if true, enforces strict parsing according to the provided inputFormat
A Dayjs object representing the parsed instant
StaticsnapSnaps a timestamp to the nearest calendar step without building the full range.
The timestamp to snap
The first timestamp in the calendar sequence
The calendar unit to apply
The nearest calendar-aligned timestamp
StaticsnapSnaps multiple timestamps to the same calendar sequence.
The timestamps to snap
The first timestamp in the calendar sequence
The calendar unit to apply
The calendar-aligned timestamps
StatictryChecks if whatever is sent looks like it could be a date.
The string to parse to check if it's a date
OptionalinputTimezone: string
Optional timezone to assume for string inputs that do not explicitly include a timezone
A native Date object representing the parsed instant in UTC or undefined if parsing fails
Staticvalidate
Class used to handle date as ISO 8601.