DateInputDirective constructor

DateInputDirective(
  1. @Optional() @Inject(datepickerClock) Clock? clock,
  2. Clock legacyClock,
  3. MaterialInputComponent _input
)

Implementation

DateInputDirective(@Optional() @Inject(datepickerClock) Clock? clock,
    Clock legacyClock, this._input)
    : _clock = clock ?? legacyClock {
  // TODO(google): Migrate to use only datepickerClock
  // TODO(google): Participate in Forms API?
  _disposer.addStreamSubscription(_input.onChange
      .listen((String? input) => _parseDate(input!, setAsCurrent: true)));
  _input.checkValid = (String? input) => _parseDateCached(input) ?? '';

  _input.requiredErrorMsg = invalidDateMsg;
}