g00fy- / angular-datepicker

calendar and datepicker directives for angular
MIT License
719 stars 420 forks source link

Fix input parsing from ng-model #251

Closed jharting closed 8 years ago

jharting commented 8 years ago
function parser(viewValue) {
  if (viewValue.length === format.length) {
    return viewValue;
  }
  return undefined;
}

The parser logic added to ng-model does not seem right. I am using format="LL" and no min/max date and what it means is that any string of length 2 is considered valid. I am adding moment's isValid() instead.