From 0b43888388d331275b1ba8d1b1068214bb8f5db4 Mon Sep 17 00:00:00 2001 From: Gabriel Muller Date: Sat, 26 Dec 2015 13:41:15 +0100 Subject: [PATCH] fixes problem minute='0' --- angularjs-datetime-picker.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/angularjs-datetime-picker.js b/angularjs-datetime-picker.js index e86247d..c039d9e 100644 --- a/angularjs-datetime-picker.js +++ b/angularjs-datetime-picker.js @@ -232,7 +232,11 @@ var month = scope.month ? (scope.month-1) : today.getMonth(); var day = scope.day || today.getDate(); var hour = scope.hour || today.getHours(); - var minute = scope.minute || today.getMinutes(); + if(scope.minute == 0){ + var minute = 0 + } else{ + var minute = scope.minute || today.getMinutes(); + } scope.selectedDate = new Date(year, month, day, hour, minute, 0); } scope.inputHour = scope.selectedDate.getHours();