angular-bootstrap-datetimepicker-directive icon indicating copy to clipboard operation
angular-bootstrap-datetimepicker-directive copied to clipboard

Manually typed date and min/max dates

Open igorbar opened this issue 9 years ago • 1 comments

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?

igorbar avatar Oct 28 '15 12:10 igorbar

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

tier2novelist avatar Oct 08 '16 08:10 tier2novelist