DateInputDirective constructor
DateInputDirective(
- @Optional() @Inject(datepickerClock) Clock? clock,
- Clock legacyClock,
- 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;
}