angular-bootstrap-datetimepicker-directive
angular-bootstrap-datetimepicker-directive copied to clipboard
Manually typed date and min/max dates
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?
Should set 'useStrict' to true in option first, otherwise dp.error won't be fired