diosney / angular-bootstrap-datetimepicker-directive

A wrapper directive around the bootstrap-datetimepicker component.
MIT License
69 stars 50 forks source link

Manually typed date and min/max dates #20

Open igorbar opened 8 years ago

igorbar commented 8 years ago

I have found an issue with saving of a manually typed date value. Set minDate $scope.datePickerOptions = { minDate: new Date() }; Type the date in past (for example: 27/10/2015). The input value is reset to previous value, but in ngModel remain invalid value. So I think need add handler for dp.error event: $element.on('dp.error', function (e) { if (ngModelCtrl) { $timeout(function () { ngModelCtrl.$setViewValue(e.target.value); }); } }).datetimepicker(options); What do you think?

tier2novelist commented 7 years ago

Should set 'useStrict' to true in option first, otherwise dp.error won't be fired