From b09ad23a18a36a3eb7cfab120e2719da3f030154 Mon Sep 17 00:00:00 2001 From: Arpita Barua <abarua@magento.com> Date: Wed, 4 Jan 2017 09:00:23 -0600 Subject: [PATCH] MAGETWO-60765: Error is thrown while scheduling an update for a locale different that US_en - Removed code duplication --- .../Magento/Ui/view/base/web/js/form/element/date.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/date.js b/app/code/Magento/Ui/view/base/web/js/form/element/date.js index 19a078e9faf..eb8dfb4b405 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/date.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/date.js @@ -141,16 +141,16 @@ define([ onShiftedValueChange: function (shiftedValue) { var value, formattedValue, - momentDateTime; + momentValue; if (shiftedValue) { + momentValue = moment(shiftedValue, this.pickerDateTimeFormat); + if (this.options.showsTime) { - momentDateTime = moment(shiftedValue, this.pickerDateTimeFormat); - formattedValue = moment(momentDateTime).format(this.timezoneFormat); + formattedValue = moment(momentValue).format(this.timezoneFormat); value = moment.tz(formattedValue, this.storeTimeZone).tz('UTC').toISOString(); } else { - value = moment(shiftedValue, this.pickerDateTimeFormat); - value = value.format(this.outputDateFormat); + value = momentValue.format(this.outputDateFormat); } } else { value = ''; -- GitLab