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([
127127 if ( this . options . showsTime ) {
128128 shiftedValue = moment . tz ( value , 'UTC' ) . tz ( this . storeTimeZone ) ;
129129 } else {
130- shiftedValue = moment ( value , this . outputDateFormat ) ;
130+ shiftedValue = moment ( value , this . outputDateFormat , true ) ;
131131 }
132132
133133 if ( ! shiftedValue . isValid ( ) ) {
Original file line number Diff line number Diff line change @@ -40,8 +40,12 @@ define([
4040 name : '' ,
4141 index : '' ,
4242 dataScope : dataScope ,
43+ outputDateFormat : 'DD-MM-YYYY' ,
44+ inputDateFormat : 'YYYY-MM-DD' ,
45+ pickerDateTimeFormat : 'DD-MM-YYYY' ,
4346 options : {
44- showsTime : true
47+ showsTime : false ,
48+ dateFormat : 'dd-MM-y'
4549 }
4650 } ) ;
4751 utils = mageUtils ;
@@ -56,5 +60,10 @@ define([
5660 expect ( utils . convertToMomentFormat ) . toHaveBeenCalled ( ) ;
5761 } ) ;
5862
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+
5968 } ) ;
6069} ) ;
You can’t perform that action at this time.
0 commit comments