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 19a078e9faf4f55e5344d3e98b30199f144aba4d..eb8dfb4b4057e8c7d8cf274062788a5849114d09 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 = '';