Skip to content

Commit bafed74

Browse files
author
Hedzer
committed
small hotfix
1 parent ce7905e commit bafed74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/timepickerdirective.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ m.directive('uiTimepicker', ['uiTimepickerConfig', '$parse', '$window', function
109109
if(element.attr('type') === 'time') {
110110
ngModel.$parsers.unshift(function(viewValue) {
111111
var date = element.timepicker('getTime', asDate());
112-
return ("0" + date.getUTCHours()).slice(-2) + ':' + ("0" + date.getUTCMinutes()).slice(-2);
112+
// Return local time (HH:mm) to avoid unintended UTC conversion
113+
return ("0" + date.getHours()).slice(-2) + ':' + ("0" + date.getMinutes()).slice(-2);
113114
});
114115
} else {
115116
ngModel.$parsers.unshift(function(viewValue) {

0 commit comments

Comments
 (0)