Commits

Matthew Schinckel  committed 444c7b7

Ensure the time is changed: we need to create a new Date() object

  • Participants
  • Parent commits b304272

Comments (0)

Files changed (1)

File src/js/timepicker.js

     var value = valueAccessor();
     var $element = $(element);
     var showTimePicker = !(element.type === 'time' && Modernizr.inputtypes.time);
-    var $widget = $("<ul class='timepicker' data-bind='foreach: times, style: {height: height}'><li data-bind='text: $data, click: $root.selectTime'></li></ul>");
+    var $widget = $("<ul class='timepicker dropdown-menu' data-bind='foreach: times, style: {height: height}'><li data-bind='text: $data, click: $root.selectTime'></li></ul>");
     
     var options = ko.mapping.fromJS(ko.bindingHandlers.time.defaultOptions, {});
     ko.mapping.fromJS(allBindingsAccessor().timeOptions || {}, options);
     });
     
     var setTime = function setTime(timeValue) {
-      var datetime = value();
+      var datetime = new Date(value());
       datetime.setHours(timeValue.getHours());
       datetime.setMinutes(timeValue.getMinutes());
       datetime.setSeconds(timeValue.getSeconds());