Fixes: U4-7624 Datepicker Sql server error

Since we are not saving the formatted value, don't try parsing the date with formatting config.
Added in explicit parsing format compatible with the one used when saving the value, just to ensure parsing is done the same way.
This commit is contained in:
Shannon
2016-01-05 15:47:42 +01:00
parent 1957d8bb3b
commit 726416fe0c

View File

@@ -97,11 +97,11 @@ function dateTimePickerController($scope, notificationsService, assetsService, a
});
if ($scope.hasDatetimePickerValue) {
//assign value to plugin/picker
var dateVal = $scope.model.value ? moment($scope.model.value, $scope.model.config.format) : moment();
var dateVal = $scope.model.value ? moment($scope.model.value, "YYYY-MM-DD HH:mm:ss") : moment();
element.datetimepicker("setValue", dateVal);
$scope.datetimePickerValue = moment($scope.model.value).format($scope.model.config.format);
$scope.datetimePickerValue = dateVal.format($scope.model.config.format);
}
element.find("input").bind("blur", function() {