File

global-context/services/domain/date-time-context-picker.service.ts

Index

Methods

Methods

getDateTimeContextByInterval
getDateTimeContextByInterval(intervalId: TimeInterval)

Calculates date time context according to provided interval.

Example :
// Returns [epoch, current date] for 'none' interval
service.getDateTimeContextByInterval('none');


// Returns [1 hour ago, now] for 'hours' interval
service.getDateTimeContextByInterval('hours');


// Returns null for invalid intervals
service.getDateTimeContextByInterval('invalid'); // null
Parameters :
Name Type Optional Description
intervalId TimeInterval No
  • Interval id indicating time range
Returns : | null

Tuple of [dateFrom, dateTo] where dateTo is current time, or null if interval is invalid

isSelectableInterval
isSelectableInterval(intervalId: Interval)

Validates provided param for being selectable Interval id.

Parameters :
Name Type Optional Description
intervalId Interval No

Interval id to be validated.

Returns : boolean

True if provided id is valid, selectable Interval id and false if it's not.

isValidAggregation
isValidAggregation(aggregation: aggregationType | null)

Validates provided aggregation type.

Parameters :
Name Type Optional Description
aggregation aggregationType | null No

Aggregation type to be validated.

Returns : boolean

Result of validation of aggregation.

isValidDateRange
isValidDateRange(stringifiedDateFrom: string, stringifiedDateTo: string)

Validates provided date "from" and date "to":

  • if both dates are proper date strings/values
  • if provided date from is earlier than date to.
Parameters :
Name Type Optional Description
stringifiedDateFrom string No

Date "from" that should be validated.

stringifiedDateTo string No

Date "to" that should be validated.

Returns : boolean

Result of validation of dates range.

results matching ""

    No results matching ""