@@ -392,7 +392,7 @@ QUnit.test('Test invalid day', function (assert) {
392392 util . paste ( $dtEditor . igDateEditor ( "field" ) [ 0 ] , "32/04/2015" ) ;
393393 $dtEditor . trigger ( "blur" ) ;
394394
395- assert . equal ( new Date ( $dtEditor . igDateEditor ( "value" ) ) . getTime ( ) , new Date ( 2015 , 03 , 30 ) . getTime ( ) , 'The initial value is not as expected' ) ;
395+ assert . equal ( new Date ( $dtEditor . igDateEditor ( "value" ) ) . getTime ( ) , new Date ( 2015 , 3 , 30 ) . getTime ( ) , 'The initial value is not as expected' ) ;
396396 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "30/04/2015" , 'The initial value is not as expected' ) ;
397397 done ( ) ;
398398 } ) . catch ( function ( er ) {
@@ -447,7 +447,7 @@ QUnit.test('Test invalid hour', function (assert) {
447447 $dtEditor . trigger ( "blur" ) ;
448448 value = $dtEditor . igDateEditor ( "value" ) ;
449449 value = new Date ( value . getFullYear ( ) , value . getMonth ( ) , value . getDate ( ) , value . getHours ( ) , value . getMinutes ( ) , value . getSeconds ( ) ) ;
450- expectedValue = new Date ( new Date ( ) . getFullYear ( ) , new Date ( ) . getMonth ( ) , new Date ( ) . getDate ( ) , 3 , 00 , 29 ) ;
450+ expectedValue = new Date ( new Date ( ) . getFullYear ( ) , new Date ( ) . getMonth ( ) , new Date ( ) . getDate ( ) , 3 , 0 , 29 ) ;
451451 // use setDate to add a day, otherwise date won't increase correctly
452452 expectedValue . setDate ( expectedValue . getDate ( ) + 1 ) ;
453453 assert . equal ( value . getTime ( ) , expectedValue . getTime ( ) , 'The initial value is not as expected' ) ;
@@ -498,8 +498,6 @@ QUnit.test('Testing date format with two digits year', function (assert) {
498498 value : '01/09/15' ,
499499 dateInputFormat : "dd/MM/yy"
500500 } ) ,
501- value ,
502- expectedValue ,
503501 done = assert . async ( ) ,
504502 util = this . util ;
505503
@@ -534,7 +532,7 @@ QUnit.test('Testing time with spin buttons and cursor position at hours', functi
534532 spinUpButton ,
535533 util = this . util ;
536534
537- $dtEditor . igDateEditor ( "value" , new Date ( today . getFullYear ( ) , today . getMonth ( ) , today . getDate ( ) , 22 , 01 , 20 ) ) ;
535+ $dtEditor . igDateEditor ( "value" , new Date ( today . getFullYear ( ) , today . getMonth ( ) , today . getDate ( ) , 22 , 1 , 20 ) ) ;
538536 $dtEditor . igDateEditor ( "setFocus" ) ;
539537
540538 this . util . wait ( 100 ) . then ( function ( ) {
@@ -573,7 +571,7 @@ QUnit.test('Testing time with spin buttons and cursor position at minutes', func
573571 spinUpButton ,
574572 util = this . util ;
575573
576- $dtEditor . igDateEditor ( "value" , new Date ( today . getFullYear ( ) , today . getMonth ( ) , today . getDate ( ) , 22 , 01 , 20 ) ) ;
574+ $dtEditor . igDateEditor ( "value" , new Date ( today . getFullYear ( ) , today . getMonth ( ) , today . getDate ( ) , 22 , 1 , 20 ) ) ;
577575 $dtEditor . igDateEditor ( "setFocus" ) ;
578576
579577 this . util . wait ( 100 ) . then ( function ( ) {
@@ -611,7 +609,7 @@ QUnit.test('Testing time with spin buttons and cursor position at seconds', func
611609 spinUpButton ,
612610 util = this . util ;
613611
614- $dtEditor . igDateEditor ( "value" , new Date ( today . getFullYear ( ) , today . getMonth ( ) , today . getDate ( ) , 22 , 01 , 20 ) ) ;
612+ $dtEditor . igDateEditor ( "value" , new Date ( today . getFullYear ( ) , today . getMonth ( ) , today . getDate ( ) , 22 , 1 , 20 ) ) ;
615613 $dtEditor . igDateEditor ( "setFocus" ) ;
616614
617615 this . util . wait ( 100 ) . then ( function ( ) {
@@ -2234,7 +2232,7 @@ QUnit.test('Testing default date formats', function (assert) {
22342232 this . util . wait ( 100 ) . then ( function ( ) {
22352233 util . paste ( $dtEditor . igDateEditor ( "field" ) [ 0 ] , displayValue ) ;
22362234 $dtEditor . trigger ( "blur" ) ;
2237- checkValue = new Date ( 2009 , 09 , 30 , 10 , 25 , 56 ) ;
2235+ checkValue = new Date ( 2009 , 9 , 30 , 10 , 25 , 56 ) ;
22382236 assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , checkValue . getTime ( ) , 'The value() method returns wrong value' ) ;
22392237 assert . equal ( $dtEditor . igDateEditor ( "getSelectedDate" ) . getTime ( ) , checkValue . getTime ( ) , "The internal date object is not correct" ) ;
22402238 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , displayValue , "The display value is not correct" ) ;
@@ -2319,7 +2317,7 @@ QUnit.test('Testing date formats with offset = 0 - UTC time', function (assert)
23192317 this . util . wait ( 100 ) . then ( function ( ) {
23202318 util . type ( "30/10/2009 10:25:56" , $dtEditor . igDateEditor ( "field" ) ) ;
23212319 $dtEditor . trigger ( "blur" ) ;
2322- checkValue = new Date ( 2009 , 09 , 30 , 10 , 25 , 56 ) ;
2320+ checkValue = new Date ( 2009 , 9 , 30 , 10 , 25 , 56 ) ;
23232321 offset = checkValue . getTimezoneOffset ( ) ;
23242322 checkValue . setMinutes ( checkValue . getMinutes ( ) - offset ) ;
23252323 assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , checkValue . getTime ( ) , 'The value() method returns wrong value' ) ;
@@ -2336,22 +2334,22 @@ QUnit.test('Testing date formats with offset = 0 - UTC time', function (assert)
23362334 displayTimeOffset : 0
23372335 } ) ;
23382336
2339- checkValue = new Date ( 2016 , 09 , 30 , 13 , 25 , 56 ) ;
2337+ checkValue = new Date ( 2016 , 9 , 30 , 13 , 25 , 56 ) ;
23402338 offset = checkValue . getTimezoneOffset ( ) ;
23412339 checkValue . setMinutes ( checkValue . getMinutes ( ) - offset ) ;
23422340 assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , checkValue . getTime ( ) , 'The value() method returns wrong value' ) ;
23432341 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "30/10/2016 13:25:56" , "The display value is not correct" ) ;
23442342 assert . equal ( $dtEditor . data ( "igDateEditor" ) . _valueInput . val ( ) , toLocalISOString ( checkValue ) , "The hidden value sent to server is not correct" ) ;
23452343
2346- utcDate = new Date ( Date . UTC ( 2016 , 09 , 25 , 12 , 0 , 0 ) ) ;
2344+ utcDate = new Date ( Date . UTC ( 2016 , 9 , 25 , 12 , 0 , 0 ) ) ;
23472345 $dtEditor . igDateEditor ( "value" , utcDate ) ;
2348- checkValue = new Date ( 2016 , 09 , 25 , 12 , 0 , 0 ) ;
2346+ checkValue = new Date ( 2016 , 9 , 25 , 12 , 0 , 0 ) ;
23492347 assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , utcDate . getTime ( ) , 'The value() method returns wrong value' ) ;
23502348 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "25/10/2016 12:00:00" , "The display value is not correct" ) ;
23512349 assert . equal ( $dtEditor . data ( "igDateEditor" ) . _valueInput . val ( ) , toLocalISOString ( utcDate ) , "The hidden value sent to server is not correct" ) ;
23522350
2353- $dtEditor . igDateEditor ( "value" , new Date ( 2016 , 09 , 25 , 12 , 0 , 0 ) ) ;
2354- offsetHours = new Date ( 2016 , 09 , 25 , 12 , 0 , 0 ) . getTimezoneOffset ( ) / 60 ;
2351+ $dtEditor . igDateEditor ( "value" , new Date ( 2016 , 9 , 25 , 12 , 0 , 0 ) ) ;
2352+ offsetHours = new Date ( 2016 , 9 , 25 , 12 , 0 , 0 ) . getTimezoneOffset ( ) / 60 ;
23552353 assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , checkValue . getTime ( ) , 'The value() method returns wrong value' ) ;
23562354 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "25/10/2016 " + pad ( 12 + offsetHours ) + ":00:00" , "The display value is not correct" ) ;
23572355 assert . equal ( $dtEditor . data ( "igDateEditor" ) . _valueInput . val ( ) , toLocalISOString ( checkValue ) , "The hidden value sent to server is not correct" ) ;
@@ -2364,22 +2362,22 @@ QUnit.test('Testing date formats with offset = 0 - UTC time', function (assert)
23642362 enableUTCDates : true
23652363 } ) ;
23662364
2367- checkValue = new Date ( 2016 , 09 , 30 , 13 , 25 , 56 ) ;
2365+ checkValue = new Date ( 2016 , 9 , 30 , 13 , 25 , 56 ) ;
23682366 offset = checkValue . getTimezoneOffset ( ) ;
23692367 checkValue . setMinutes ( checkValue . getMinutes ( ) - offset ) ;
23702368 assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , checkValue . getTime ( ) , 'The value() method returns wrong value' ) ;
23712369 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "30/10/2016 13:25:56" , "The display value is not correct" ) ;
23722370 assert . equal ( $dtEditor . data ( "igDateEditor" ) . _valueInput . val ( ) , checkValue . toISOString ( ) , "The hidden value sent to server is not correct" ) ;
23732371
2374- utcDate = new Date ( Date . UTC ( 2016 , 09 , 25 , 12 , 0 , 0 ) ) ;
2372+ utcDate = new Date ( Date . UTC ( 2016 , 9 , 25 , 12 , 0 , 0 ) ) ;
23752373 $dtEditor . igDateEditor ( "value" , utcDate ) ;
2376- checkValue = new Date ( 2016 , 09 , 25 , 12 , 0 , 0 ) ;
2374+ checkValue = new Date ( 2016 , 9 , 25 , 12 , 0 , 0 ) ;
23772375 assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , utcDate . getTime ( ) , 'The value() method returns wrong value' ) ;
23782376 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "25/10/2016 12:00:00" , "The display value is not correct" ) ;
23792377 assert . equal ( $dtEditor . data ( "igDateEditor" ) . _valueInput . val ( ) , utcDate . toISOString ( ) , "The hidden value sent to server is not correct" ) ;
23802378
2381- $dtEditor . igDateEditor ( "value" , new Date ( 2016 , 09 , 25 , 12 , 0 , 0 ) ) ;
2382- offsetHours = new Date ( 2016 , 09 , 25 , 12 , 0 , 0 ) . getTimezoneOffset ( ) / 60 ;
2379+ $dtEditor . igDateEditor ( "value" , new Date ( 2016 , 9 , 25 , 12 , 0 , 0 ) ) ;
2380+ offsetHours = new Date ( 2016 , 9 , 25 , 12 , 0 , 0 ) . getTimezoneOffset ( ) / 60 ;
23832381 assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , checkValue . getTime ( ) , 'The value() method returns wrong value' ) ;
23842382 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "25/10/2016 " + pad ( 12 + offsetHours ) + ":00:00" , "The display value is not correct" ) ;
23852383 assert . equal ( $dtEditor . data ( "igDateEditor" ) . _valueInput . val ( ) , checkValue . toISOString ( ) , "The hidden value sent to server is not correct" ) ;
@@ -2410,8 +2408,8 @@ QUnit.test('Testing date formats with offset defined', function (assert) {
24102408 } ) ;
24112409
24122410 hoursOffset = new Date ( "2016-10-30T13:25:56.000Z" ) . getTimezoneOffset ( ) / 60 ;
2413- checkValue = new Date ( 2016 , 09 , 30 , 20 , 25 , 56 ) ;
2414- assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , new Date ( 2016 , 09 , 30 , 13 - hoursOffset , 25 , 56 ) . getTime ( ) , 'The value() method returns wrong value' ) ;
2411+ checkValue = new Date ( 2016 , 9 , 30 , 20 , 25 , 56 ) ;
2412+ assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , new Date ( 2016 , 9 , 30 , 13 - hoursOffset , 25 , 56 ) . getTime ( ) , 'The value() method returns wrong value' ) ;
24152413 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "30/10/2016 20:25:56" , "The display value is not correct" ) ;
24162414 assert . equal ( $dtEditor . data ( "igDateEditor" ) . _valueInput . val ( ) , "2016-10-30T13:25:56.000Z" , "The hidden value sent to server is not correct" ) ;
24172415
@@ -2420,8 +2418,8 @@ QUnit.test('Testing date formats with offset defined', function (assert) {
24202418 this . util . wait ( 100 ) . then ( function ( ) {
24212419 util . type ( "30/10/2016 22:25:56" , $dtEditor . igDateEditor ( "field" ) ) ;
24222420 $dtEditor . trigger ( "blur" ) ;
2423- checkValue = new Date ( 2016 , 09 , 30 , 22 , 25 , 56 ) ;
2424- assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , new Date ( 2016 , 09 , 30 , 15 - hoursOffset , 25 , 56 ) . getTime ( ) , 'The value() method returns wrong value' ) ;
2421+ checkValue = new Date ( 2016 , 9 , 30 , 22 , 25 , 56 ) ;
2422+ assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , new Date ( 2016 , 9 , 30 , 15 - hoursOffset , 25 , 56 ) . getTime ( ) , 'The value() method returns wrong value' ) ;
24252423 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "30/10/2016 22:25:56" , "The display value is not correct" ) ;
24262424 assert . equal ( $dtEditor . data ( "igDateEditor" ) . _valueInput . val ( ) , "2016-10-30T15:25:56.000Z" , "The hidden value sent to server is not correct" ) ;
24272425 $dtEditor . remove ( ) ;
@@ -2434,8 +2432,8 @@ QUnit.test('Testing date formats with offset defined', function (assert) {
24342432 } ) ;
24352433
24362434 hoursOffset = new Date ( "2016-10-30T13:25:56.000Z" ) . getTimezoneOffset ( ) / 60 ;
2437- checkValue = new Date ( 2016 , 09 , 30 , 20 , 25 , 56 ) ;
2438- assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , new Date ( 2016 , 09 , 30 , 13 - hoursOffset , 25 , 56 ) . getTime ( ) , 'The value() method returns wrong value' ) ;
2435+ checkValue = new Date ( 2016 , 9 , 30 , 20 , 25 , 56 ) ;
2436+ assert . equal ( $dtEditor . igDateEditor ( "value" ) . getTime ( ) , new Date ( 2016 , 9 , 30 , 13 - hoursOffset , 25 , 56 ) . getTime ( ) , 'The value() method returns wrong value' ) ;
24392437 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "30/10/2016 20:25:56" , "The display value is not correct" ) ;
24402438 assert . equal ( $dtEditor . data ( "igDateEditor" ) . _valueInput . val ( ) , "2016-10-30T13:25:56.000Z" , "The hidden value sent to server is not correct" ) ;
24412439 $dtEditor . remove ( ) ;
@@ -4391,7 +4389,7 @@ QUnit.test('Spin boundary values and update date object parts that are missing i
43914389QUnit . test ( 'Test invalid composition value' , function ( assert ) {
43924390 assert . expect ( 3 ) ;
43934391 var $dtEditor = this . util . appendToFixture ( this . inputTag ) . igDateEditor ( {
4394- value : new Date ( 2015 , 04 , 01 )
4392+ value : new Date ( 2015 , 4 , 1 )
43954393 } ) ,
43964394 $field = $dtEditor . igDateEditor ( "field" ) ,
43974395 done = assert . async ( ) ,
@@ -4413,7 +4411,7 @@ QUnit.test('Test invalid composition value', function (assert) {
44134411 assert . equal ( $field . val ( ) , "05/01/2015" , "Text should remain on invalid composition value." ) ;
44144412 assert . ok ( $field [ 0 ] . selectionStart === 0 && $field [ 0 ] . selectionEnd === 10 , "Entire value should be selected." ) ;
44154413 $field . blur ( ) ;
4416- assert . equal ( $dtEditor . igDateEditor ( "value" ) && $dtEditor . igDateEditor ( "value" ) . getTime ( ) , new Date ( 2015 , 04 , 01 ) . getTime ( ) , "value did not stay the same" ) ;
4414+ assert . equal ( $dtEditor . igDateEditor ( "value" ) && $dtEditor . igDateEditor ( "value" ) . getTime ( ) , new Date ( 2015 , 4 , 1 ) . getTime ( ) , "value did not stay the same" ) ;
44174415
44184416 done ( ) ;
44194417 } ) . catch ( function ( er ) {
@@ -4465,7 +4463,7 @@ QUnit.test('Testing spin minutes in 12 hours format', function (assert) {
44654463 $dtEditor . data ( "igDateEditor" ) . _setCursorPosition ( 12 ) ;
44664464 util . click ( spinUpButton , false , false ) ;
44674465 $dtEditor . trigger ( "blur" ) ;
4468- expectedValue = new Date ( 2017 , 11 , 9 , 1 , 00 ) ;
4466+ expectedValue = new Date ( 2017 , 11 , 9 , 1 , 0 ) ;
44694467 value = $dtEditor . igDateEditor ( "value" ) ;
44704468 assert . equal ( value . getTime ( ) , expectedValue . getTime ( ) , 'The initial value is not as expected' ) ;
44714469 assert . equal ( $dtEditor . igDateEditor ( "displayValue" ) , "12/9/2017 1:00 AM" , 'The initial value is not as expected' ) ;
0 commit comments