MaterialDateRangePickerComponent constructor

MaterialDateRangePickerComponent(
  1. @Optional() @Inject(datepickerClock) Clock? clock,
  2. Clock legacyClock,
  3. @Optional() DatepickerConfig? config,
  4. @Attribute('popupClass') String? popupClass,
  5. @Optional() @SkipSelf() PopupSizeProvider? _popupSizeProvider,
  6. HtmlElement element,
  7. DomService _domService,
  8. NgZone _ngZone,
)

Implementation

MaterialDateRangePickerComponent(
    @Optional() @Inject(datepickerClock) Clock? clock,
    Clock legacyClock,
    @Optional() DatepickerConfig? config,
    @Attribute('popupClass') String? popupClass,
    @Optional() @SkipSelf() this._popupSizeProvider,
    HtmlElement element,
    this._domService,
    this._ngZone)
    : _config = config ?? DatepickerConfig(),
      popupClassName = constructEncapsulatedCss(popupClass, element.classes) {
  // TODO(google): Migrate to use only datepickerClock
  clock ??= legacyClock;

  // Init minDate and maxDate to sensible defaults
  var now = clock.now();
  minDate = Date(now.year - 10, DateTime.january, 1);
  maxDate = Date(now.year + 10, DateTime.december, 31);
}