File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
app/code/Magento/Ui/view/base/web/js/form/element
dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ define([
127
127
if ( this . options . showsTime ) {
128
128
shiftedValue = moment . tz ( value , 'UTC' ) . tz ( this . storeTimeZone ) ;
129
129
} else {
130
- shiftedValue = moment ( value , this . outputDateFormat ) ;
130
+ shiftedValue = moment ( value , this . outputDateFormat , true ) ;
131
131
}
132
132
133
133
if ( ! shiftedValue . isValid ( ) ) {
Original file line number Diff line number Diff line change @@ -40,8 +40,12 @@ define([
40
40
name : '' ,
41
41
index : '' ,
42
42
dataScope : dataScope ,
43
+ outputDateFormat : 'DD-MM-YYYY' ,
44
+ inputDateFormat : 'YYYY-MM-DD' ,
45
+ pickerDateTimeFormat : 'DD-MM-YYYY' ,
43
46
options : {
44
- showsTime : true
47
+ showsTime : false ,
48
+ dateFormat : 'dd-MM-y'
45
49
}
46
50
} ) ;
47
51
utils = mageUtils ;
@@ -56,5 +60,10 @@ define([
56
60
expect ( utils . convertToMomentFormat ) . toHaveBeenCalled ( ) ;
57
61
} ) ;
58
62
63
+ it ( 'Check date will have correct value with different locales.' , function ( ) {
64
+ model . value ( '2020-11-28' ) ;
65
+ expect ( model . getPreview ( ) ) . toBe ( '28-11-2020' ) ;
66
+ } ) ;
67
+
59
68
} ) ;
60
69
} ) ;
You can’t perform that action at this time.
0 commit comments