DateRangeService

A service that handles the communication between the components that are placed inside the DateRangeComponent.
For example, the start and end DateInput and DateRangePopup components.

activeRangeEnd$ BehaviorSubject<SelectionRangeEnd>

An Observable instance that notifies when the activeRangeEnd state is changed.

dateRangePopup$ BehaviorSubject<DateRangePopupComponent>

An Observable instance that notifies when the DateRangePopup component is changed.

endInput$ BehaviorSubject<DateInputComponent>

An Observable instance that notifies when the end DateInput component is changed.
For example, when a new end DateInput is attached or when the old one is detached.

focusedDate$ BehaviorSubject

An Observable instance that notifies when the focusedDate is changed.

range$ BehaviorSubject<SelectionRange>

An Observable instance that notifies when the state of the selection range is changed.

startInput$ BehaviorSubject<DateInputComponent>

An Observable instance that notifies when the start DateInput component is changed.
For example, when a new start DateInput is attached or the old one is detached.

activeRangeEnd SelectionRangeEnd

Gets the current activeRangeEnd value.

focusedDate Date

Gets the current focusedDate value.

max Date

Gets the max range value.
The max value is extracted from the end DateInput value or the max value of the Calendar.

min Date

Gets the min range value.
The min value is extracted from the start DateInput value or the min value of the Calendar.

selectionRange SelectionRange

Gets the current selectionRange value.

Methods

activatePopup

Activates the registered DateRangePopup component.
The method opens the popup and focuses the calendar.

deactivatePopup

Deactivates the registered DateRangePopup component.
The method closes the popup.

destroy

Completes all observables to mitigate possible memory leaks.
Calls the method when a component that uses it is destroyed.

hasActiveComponent

Returns true when an active component that is placed inside the DateRangeComponent is detected.
For example, the opened popup or the focused DateInput.

Returns

boolean true if an active component is present.

registerEndInput

Registers a new end DateInput component. Notifies all endInput$ listeners.

Parameters

endInput DateInputComponent

registerPopup

Registers a new DateRangePopup component. Notifies all dateRangePopup$ listeners.

Parameters

dateRangePopup DateRangePopupComponent

registerStartInput

Registers a new start DateInput component. Notifies all startInput$ listeners.

Parameters

startInput DateInputComponent

setActiveRangeEnd

Updates the activeRangeEnd value. Notifies all activeRangeEnd$ listeners.

Parameters

activeRange SelectionRangeEnd

setFocusedDate

Updates the focused date. Notifies all focusedDate$ listeners.

Parameters

value Date

setRange

Updates the selection range. Notifies all range$ listeners.

Parameters

range SelectionRange