Skip to content

Commit 2009a1a

Browse files
committed
Merge branch 'MAGETWO-31689' into MAGETWO-31191
2 parents 3c4449d + 42ab5e4 commit 2009a1a

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

app/code/Magento/Ui/view/base/layout/ui_components.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
<arguments>
133133
<argument name="js_config" xsi:type="array">
134134
<item name="extends" xsi:type="string">input</item>
135+
<item name="component" xsi:type="string">Magento_Ui/js/form/element/date</item>
135136
<item name="config" xsi:type="array">
136137
<item name="input_type" xsi:type="string">date</item>
137138
</item>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
3+
*/
4+
define([
5+
'moment',
6+
'./abstract'
7+
], function (moment, Abstract) {
8+
'use strict';
9+
10+
return Abstract.extend({
11+
defaults: {
12+
dateFormat: 'MM/DD/YYYY'
13+
},
14+
15+
/**
16+
* Converts initial value to the specified date format.
17+
*
18+
* @returns {String}
19+
*/
20+
getInititalValue: function () {
21+
var value = this._super();
22+
23+
if (value) {
24+
value = moment(value).format(this.dateFormat);
25+
}
26+
27+
return value;
28+
}
29+
});
30+
});

0 commit comments

Comments
 (0)