Skip to content

Commit 7b894b4

Browse files
committed
MAGETWO-59718: Date sets to 2020 year after save
- Added code changes per code review comments
1 parent 8db352e commit 7b894b4

File tree

1 file changed

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

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright © 2015 Magento. All rights reserved.
2+
* Copyright © 2016 Magento. All rights reserved.
33
* See COPYING.txt for license details.
44
*/
55
define([
@@ -166,8 +166,7 @@ define([
166166
*/
167167
prepareDateTimeFormats: function () {
168168
this.pickerDateTimeFormat = this.options.dateFormat;
169-
this.momentFormat = (this.options.dateFormat)? this.convertToMomentFormat(this.options.dateFormat) :
170-
this.momentFormat;
169+
this.momentFormat = (this.options.dateFormat) ? this.convertToMomentFormat(this.options.dateFormat) : this.momentFormat;
171170
if (this.options.showsTime) {
172171
this.pickerDateTimeFormat += ' ' + this.options.timeFormat;
173172
}
@@ -189,7 +188,9 @@ define([
189188
* @returns {String} Moment compatible format
190189
*/
191190
convertToMomentFormat: function (format){
192-
var newFormat = format.replace(/yy|y/gi, 'YYYY'); // replace the year
191+
var newFormat;
192+
193+
newFormat = format.replace(/yy|y/gi, 'YYYY'); // replace the year
193194
newFormat = newFormat.replace(/dd|d/g, 'DD'); // replace the date
194195
newFormat = newFormat.replace(/mm|m/g, 'MM'); //replace the month
195196
return newFormat;

0 commit comments

Comments
 (0)