@@ -3464,43 +3464,43 @@ QUnit.module('Global formatting config (spec)', {
34643464 assert . strictEqual ( $input . val ( ) , '1/2/2020' ) ;
34653465 } ) ;
34663466
3467- QUnit . test ( 'defaultOptions displayFormat keeps priority over global dateFormat' , function ( assert ) {
3467+ QUnit . test ( 'implicit DateBox uses dateTimeFormatPresets.shortDate when no dateFormat is set ' , function ( assert ) {
34683468 config ( {
34693469 ...config ( ) ,
3470- dateFormat : 'dd/MM/yyyy' ,
3471- } ) ;
3472- DateBox . defaultOptions ( {
3473- options : {
3474- displayFormat : 'yyyy-MM-dd' ,
3470+ dateTimeFormatPresets : {
3471+ shortDate : 'dd/MM/yyyy' ,
34753472 } ,
34763473 } ) ;
34773474
34783475 const $element = $ ( '#dateBox' ) . dxDateBox ( {
34793476 type : 'date' ,
3480- value : new Date ( 2020 , 0 , 2 ) ,
3477+ value : new Date ( 2020 , 0 , 3 ) ,
34813478 pickerType : 'calendar' ,
34823479 } ) ;
34833480 const $input = $element . find ( `.${ TEXTEDITOR_INPUT_CLASS } ` ) ;
34843481
3485- assert . strictEqual ( $input . val ( ) , '2020-01-02 ' ) ;
3482+ assert . strictEqual ( $input . val ( ) , '03/01/2020 ' ) ;
34863483 } ) ;
34873484
3488- QUnit . test ( 'implicit DateBox uses dateTimeFormatPresets.shortDate when no dateFormat is set ' , function ( assert ) {
3485+ QUnit . test ( 'defaultOptions displayFormat keeps priority over global dateFormat' , function ( assert ) {
34893486 config ( {
34903487 ...config ( ) ,
3491- dateTimeFormatPresets : {
3492- shortDate : 'dd/MM/yyyy' ,
3488+ dateFormat : 'dd/MM/yyyy' ,
3489+ } ) ;
3490+ DateBox . defaultOptions ( {
3491+ options : {
3492+ displayFormat : 'yyyy-MM-dd' ,
34933493 } ,
34943494 } ) ;
34953495
34963496 const $element = $ ( '#dateBox' ) . dxDateBox ( {
34973497 type : 'date' ,
3498- value : new Date ( 2020 , 0 , 3 ) ,
3498+ value : new Date ( 2020 , 0 , 2 ) ,
34993499 pickerType : 'calendar' ,
35003500 } ) ;
35013501 const $input = $element . find ( `.${ TEXTEDITOR_INPUT_CLASS } ` ) ;
35023502
3503- assert . strictEqual ( $input . val ( ) , '03/01/ 2020' ) ;
3503+ assert . strictEqual ( $input . val ( ) , '2020-01-02 ' ) ;
35043504 } ) ;
35053505
35063506 QUnit . test ( 'dateFormat takes priority over dateTimeFormatPresets.shortDate for implicit DateBox' , function ( assert ) {
0 commit comments