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 bb12f0404d..2c3495120a 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 @@ -63,7 +63,7 @@ function dateTimePickerController($scope, notificationsService, assetsService, a //sets the scope model value accordingly - this is the value to be sent up to the server and depends on // if the picker is configured to offset time. We always format the date/time in a specific format for sending // to the server, this is different from the format used to display the date/time. - function setModelValue() { + function setModelValue() { if ($scope.hasDatetimePickerValue) { var elementData = $element.find("div:first").data().DateTimePicker; if ($scope.model.config.pickTime) { @@ -95,6 +95,19 @@ function dateTimePickerController($scope, notificationsService, assetsService, a } $scope.serverTime = null; + $scope.serverTimeNeedsOffsetting = false; + if (Umbraco.Sys.ServerVariables.application.serverTimeOffset !== undefined) { + // Will return something like 120 + var serverOffset = Umbraco.Sys.ServerVariables.application.serverTimeOffset; + + // Will return something like -120 + var localOffset = new Date().getTimezoneOffset(); + + // If these aren't equal then offsetting is needed + // note the minus in front of serverOffset needed + // because C# and javascript return the inverse offset + $scope.serverTimeNeedsOffsetting = (-serverOffset !== localOffset); + } //get the current user to see if we can localize this picker userService.getCurrentUser().then(function (user) { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html index c9b83cc8ed..472c0a478b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html @@ -18,8 +18,9 @@ {{datePickerForm.datepicker.errorMsg}} Invalid date -

- Server time: {{serverTime}} +

+ The time you picked is your local time. This translates to the following time on the server: {{serverTime}}
+ What does this mean?

Clear date diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 84dedbb364..0c35794913 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -169,6 +169,8 @@ Not a member of group(s) Child items Target + This translates to the following time on the server:]]> + What does this mean?]]> Click to upload diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index ec41299b25..c85053191f 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -170,6 +170,8 @@ Not a member of group(s) Child items Target + This translates to the following time on the server:]]> + What does this mean?]]> Click to upload