Skip to content

Commit b09ad23

Browse files
committed
MAGETWO-60765: Error is thrown while scheduling an update for a locale different that US_en
- Removed code duplication
1 parent 71f621e commit b09ad23

File tree

1 file changed

+5
-5
lines changed
  • app/code/Magento/Ui/view/base/web/js/form/element

1 file changed

+5
-5
lines changed

app/code/Magento/Ui/view/base/web/js/form/element/date.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,16 @@ define([
141141
onShiftedValueChange: function (shiftedValue) {
142142
var value,
143143
formattedValue,
144-
momentDateTime;
144+
momentValue;
145145

146146
if (shiftedValue) {
147+
momentValue = moment(shiftedValue, this.pickerDateTimeFormat);
148+
147149
if (this.options.showsTime) {
148-
momentDateTime = moment(shiftedValue, this.pickerDateTimeFormat);
149-
formattedValue = moment(momentDateTime).format(this.timezoneFormat);
150+
formattedValue = moment(momentValue).format(this.timezoneFormat);
150151
value = moment.tz(formattedValue, this.storeTimeZone).tz('UTC').toISOString();
151152
} else {
152-
value = moment(shiftedValue, this.pickerDateTimeFormat);
153-
value = value.format(this.outputDateFormat);
153+
value = momentValue.format(this.outputDateFormat);
154154
}
155155
} else {
156156
value = '';

0 commit comments

Comments
 (0)