MCPcopy Create free account
hub / github.com/angular/components / _setRanges

Method _setRanges

src/material/datepicker/month-view.ts:599–612  ·  view source on GitHub ↗

Sets the current range based on a model value.

(selectedValue: DateRange<D> | D | null)

Source from the content-addressed store, hash-verified

597
598 /** Sets the current range based on a model value. */
599 private _setRanges(selectedValue: DateRange<D> | D | null) {
600 if (selectedValue instanceof DateRange) {
601 this._rangeStart.set(this._getCellCompareValue(selectedValue.start));
602 this._rangeEnd.set(this._getCellCompareValue(selectedValue.end));
603 this._isRange.set(true);
604 } else {
605 this._rangeStart.set(this._getCellCompareValue(selectedValue));
606 this._rangeEnd.set(this._rangeStart());
607 this._isRange.set(false);
608 }
609
610 this._comparisonRangeStart.set(this._getCellCompareValue(this.comparisonStart));
611 this._comparisonRangeEnd.set(this._getCellCompareValue(this.comparisonEnd));
612 }
613
614 /** Gets whether a date can be selected in the month view. */
615 private _canSelect(date: D) {

Callers 3

selectedMethod · 0.95
ngOnChangesMethod · 0.95
_initMethod · 0.95

Calls 2

_getCellCompareValueMethod · 0.95
setMethod · 0.80

Tested by

no test coverage detected