Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Added ability to handle empty model in timepicker #4203

Closed
wants to merge 5 commits into from

Conversation

fmccown
Copy link

@fmccown fmccown commented Aug 13, 2015

Model can be empty so user must type values into the hour and minute
text boxes. This closes #1114.

Model can be empty so user must type values into the hour and minute
text boxes.
@@ -255,7 +267,10 @@ angular.module('ui.bootstrap.timepicker', [])
};

minutesInputEl.bind('blur', function(e) {
if (!$scope.invalidMinutes && $scope.minutes < 10) {
ngModelCtrl.$setTouched();
if ($scope.minutes === null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to if(!$scope.minutes) {

@anthonmanix
Copy link

I don't think he should change value === null to !value, because that won't work for 0 hours and 0 minutes.

@wesleycho
Copy link
Contributor

Good point - however, the other aspects are still issues.

@wesleycho
Copy link
Contributor

Even with code style cleaned up, this PR fails tests.

It needs to be worked on before this can be accepted.

@ftorghele
Copy link

the PR is green now

@wesleycho
Copy link
Contributor

History needs to be cleaned up - there should not be any merge commits.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TimePicker shows current time when model is empty.
5 participants