From e8e275b567104ee45a26ecd96cdbc76959747382 Mon Sep 17 00:00:00 2001 From: Daniel Gornstein Date: Sun, 10 Jan 2016 18:50:55 -0800 Subject: [PATCH] fix(timepicker): Don't allow mixture of numbers and letters. Closes #5085 --- src/timepicker/timepicker.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/timepicker/timepicker.js b/src/timepicker/timepicker.js index eacbdd6444..67c02f7849 100644 --- a/src/timepicker/timepicker.js +++ b/src/timepicker/timepicker.js @@ -51,14 +51,14 @@ angular.module('ui.bootstrap.timepicker', []) var hourStep = timepickerConfig.hourStep; if ($attrs.hourStep) { $scope.$parent.$watch($parse($attrs.hourStep), function(value) { - hourStep = parseInt(+value, 10); + hourStep = +value; }); } var minuteStep = timepickerConfig.minuteStep; if ($attrs.minuteStep) { $scope.$parent.$watch($parse($attrs.minuteStep), function(value) { - minuteStep = parseInt(+value, 10); + minuteStep = +value; }); } @@ -128,7 +128,7 @@ angular.module('ui.bootstrap.timepicker', []) var secondStep = timepickerConfig.secondStep; if ($attrs.secondStep) { $scope.$parent.$watch($parse($attrs.secondStep), function(value) { - secondStep = parseInt(+value, 10); + secondStep = +value; }); } @@ -160,7 +160,7 @@ angular.module('ui.bootstrap.timepicker', []) // Get $scope.hours in 24H mode if valid function getHoursFromTemplate() { - var hours = parseInt(+$scope.hours, 10); + var hours = +$scope.hours; var valid = $scope.showMeridian ? hours > 0 && hours < 13 : hours >= 0 && hours < 24; if (!valid) { @@ -179,12 +179,12 @@ angular.module('ui.bootstrap.timepicker', []) } function getMinutesFromTemplate() { - var minutes = parseInt(+$scope.minutes, 10); + var minutes = +$scope.minutes; return minutes >= 0 && minutes < 60 ? minutes : undefined; } function getSecondsFromTemplate() { - var seconds = parseInt(+$scope.seconds, 10); + var seconds = +$scope.seconds; return seconds >= 0 && seconds < 60 ? seconds : undefined; }