File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
app/code/Magento/Ui/view/base/web/js/form/element Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -75,13 +75,11 @@ define([
75
75
initConfig : function ( ) {
76
76
this . _super ( ) ;
77
77
78
- var options = {
78
+ utils . extend ( this . options , {
79
79
showsTime : this . showsTime ,
80
80
timeFormat : this . timeFormat ,
81
81
dateFormat : this . dateFormat
82
- } ;
83
-
84
- utils . extend ( this . options , options ) ;
82
+ } ) ;
85
83
86
84
this . prepareDatetimeFormats ( ) ;
87
85
@@ -102,17 +100,16 @@ define([
102
100
* @param {String } value
103
101
*/
104
102
onValueChange : function ( value ) {
105
- var shiftedValue ;
103
+ var dateFormat ,
104
+ shiftedValue ;
106
105
107
106
if ( value ) {
108
107
if ( this . showsTime ) {
109
108
shiftedValue = moment . utc ( value ) . add ( this . timeOffset , 'seconds' ) ;
110
109
} else {
111
- shiftedValue = moment ( value , this . outputDateFormat ) ;
110
+ dateFormat = this . shiftedValue ( ) ? this . outputDateFormat : this . inputDateFormat ;
112
111
113
- if ( ! this . shiftedValue ( ) ) {
114
- shiftedValue = moment ( value , this . inputDateFormat ) ;
115
- }
112
+ shiftedValue = moment ( value , dateFormat ) ;
116
113
}
117
114
118
115
shiftedValue = shiftedValue . format ( this . datetimeFormat ) ;
You can’t perform that action at this time.
0 commit comments