Fixes: U4-5333 Datepicker starts on today's date instead of current value when you switch nodes

This commit is contained in:
Shannon
2014-08-15 13:48:07 -06:00
parent 69244f6991
commit 1686e2f4bf

View File

@@ -47,13 +47,16 @@ function dateTimePickerController($scope, notificationsService, assetsService, a
// Get the id of the datepicker button that was clicked
var pickerId = $scope.model.alias;
// Open the datepicker and add a changeDate eventlistener
$element.find("div:first")
.datetimepicker($scope.model.config)
.on("changeDate", applyDate);
//now assign the date
$("#datepicker" + pickerId).val($scope.model.value);
if ($scope.model.value) {
//manually assign the date to the plugin
$element.find("div:first").datetimepicker("setValue", $scope.model.value);
}
//Ensure to remove the event handler when this instance is destroyted
$scope.$on('$destroy', function () {