@@ -4,7 +4,7 @@ q.dateParser = require(__dirname + "/../../../lib/types").getTypeParser(1114, 't
44q . stringArrayParser = require ( __dirname + "/../../../lib/types" ) . getTypeParser ( 1009 , 'text' ) ;
55
66test ( "testing dateParser" , function ( ) {
7- assert . equal ( q . dateParser ( "2010-12-11 09:09:04" ) . toUTCString ( ) , new Date ( "2010-12-11 09:09:04 GMT " ) . toUTCString ( ) ) ;
7+ assert . equal ( q . dateParser ( "2010-12-11 09:09:04" ) . toString ( ) , new Date ( "2010-12-11 09:09:04" ) . toString ( ) ) ;
88} ) ;
99
1010var testForMs = function ( part , expected ) {
@@ -19,19 +19,19 @@ testForMs('.1', 100);
1919testForMs ( '.01' , 10 ) ;
2020testForMs ( '.74' , 740 ) ;
2121
22- test ( "testing 2dateParser" , function ( ) {
22+ test ( "testing 2dateParser on dates without timezones " , function ( ) {
2323 var actual = "2010-12-11 09:09:04.1" ;
24- var expected = "\"2010-12-11T09:09:04.100Z\"" ;
24+ var expected = JSON . stringify ( new Date ( 2010 , 11 , 11 , 9 , 9 , 4 , 100 ) )
2525 assert . equal ( JSON . stringify ( q . dateParser ( actual ) ) , expected ) ;
2626} ) ;
2727
28- test ( "testing 2dateParser" , function ( ) {
28+ test ( "testing 2dateParser on dates with timezones " , function ( ) {
2929 var actual = "2011-01-23 22:15:51.28-06" ;
3030 var expected = "\"2011-01-24T04:15:51.280Z\"" ;
3131 assert . equal ( JSON . stringify ( q . dateParser ( actual ) ) , expected ) ;
3232} ) ;
3333
34- test ( "testing 2dateParser" , function ( ) {
34+ test ( "testing 2dateParser on dates with huge millisecond value " , function ( ) {
3535 var actual = "2011-01-23 22:15:51.280843-06" ;
3636 var expected = "\"2011-01-24T04:15:51.280Z\"" ;
3737 assert . equal ( JSON . stringify ( q . dateParser ( actual ) ) , expected ) ;
0 commit comments