@@ -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
@@ -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 ( ) ;
0 commit comments