From 3a4f0f4c114f80d4d1c7463daa7510dedcc78792 Mon Sep 17 00:00:00 2001 From: Claus Date: Mon, 4 Jan 2016 11:56:59 +0100 Subject: [PATCH] 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. --- .../propertyeditors/datepicker/datepicker.controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js index fe413e0159..fe7f1bcf9b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js @@ -96,11 +96,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() {