@@ -230,6 +230,46 @@ QUnit.module('datebox tests', moduleConfig, () => {
230230 }
231231 } ) ;
232232
233+ QUnit . test ( 'Datebox should set min/max attributes to datetime input in localized datetime format (T1252602)' , function ( assert ) {
234+ const $dateBox = $ ( '#dateBox' ) . dxDateBox ( {
235+ type : 'datetime' ,
236+ pickerType : 'native' ,
237+ value : new Date ( 2024 , 8 , 15 , 16 , 54 , 10 ) ,
238+ min : new Date ( 2024 , 8 , 10 , 16 , 54 , 14 ) ,
239+ max : new Date ( 2024 , 8 , 27 , 16 , 54 , 15 )
240+ } ) ;
241+
242+ const $input = $dateBox . find ( `.${ TEXTEDITOR_INPUT_CLASS } ` ) ;
243+ assert . equal ( $input . attr ( 'min' ) , '2024-09-10T16:54:14' , 'minimum date set correctly' ) ;
244+ assert . equal ( $input . attr ( 'max' ) , '2024-09-27T16:54:15' , 'maximum date set correctly' ) ;
245+ } ) ;
246+
247+ QUnit . test ( 'Datebox should set min/max attributes to time input in localized time format (T1252602)' , function ( assert ) {
248+ const $dateBox = $ ( '#dateBox' ) . dxDateBox ( {
249+ type : 'time' ,
250+ pickerType : 'native' ,
251+ value : new Date ( 2024 , 8 , 10 , 16 , 30 ) ,
252+ min : new Date ( 2024 , 8 , 10 , 12 , 0 , 14 ) ,
253+ max : new Date ( 2024 , 8 , 10 , 18 , 0 , 15 )
254+ } ) ;
255+ const $input = $dateBox . find ( `.${ TEXTEDITOR_INPUT_CLASS } ` ) ;
256+ assert . equal ( $input . attr ( 'min' ) , '12:00:14' , 'minimum time set correctly' ) ;
257+ assert . equal ( $input . attr ( 'max' ) , '18:00:15' , 'maximum time set correctly' ) ;
258+ } ) ;
259+
260+ QUnit . test ( 'Datebox should set min/max attributes to date input in localized date format (T1252602)' , function ( assert ) {
261+ const $dateBox = $ ( '#dateBox' ) . dxDateBox ( {
262+ type : 'date' ,
263+ pickerType : 'native' ,
264+ value : new Date ( 2024 , 8 , 15 ) ,
265+ min : new Date ( 2024 , 8 , 10 ) ,
266+ max : new Date ( 2024 , 8 , 20 )
267+ } ) ;
268+ const $input = $dateBox . find ( `.${ TEXTEDITOR_INPUT_CLASS } ` ) ;
269+ assert . equal ( $input . attr ( 'min' ) , '2024-09-10' , 'minimum date set correctly' ) ;
270+ assert . equal ( $input . attr ( 'max' ) , '2024-09-20' , 'maximum date set correctly' ) ;
271+ } ) ;
272+
233273 QUnit . test ( 'T204179 - dxDateBox should not render dropDownButton only for generic device when pickerType is \'native\'' , function ( assert ) {
234274 const $dateBox = $ ( '#dateBox' ) . dxDateBox ( {
235275 pickerType : 'native'
0 commit comments