File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,12 @@ var stringify = function stringify(
7575 } else if ( obj instanceof Date ) {
7676 obj = serializeDate ( obj ) ;
7777 } else if ( generateArrayPrefix === 'comma' && isArray ( obj ) ) {
78- obj = obj . join ( ',' ) ;
78+ obj = utils . maybeMap ( obj , function ( value ) {
79+ if ( value instanceof Date ) {
80+ return serializeDate ( value ) ;
81+ }
82+ return value ;
83+ } ) . join ( ',' ) ;
7984 }
8085
8186 if ( obj === null ) {
Original file line number Diff line number Diff line change @@ -595,6 +595,18 @@ test('stringify()', function (t) {
595595 'custom serializeDate function called'
596596 ) ;
597597
598+ st . equal (
599+ qs . stringify (
600+ { a : [ date ] } ,
601+ {
602+ serializeDate : function ( d ) { return d . getTime ( ) ; } ,
603+ arrayFormat : 'comma'
604+ }
605+ ) ,
606+ 'a=' + date . getTime ( ) ,
607+ 'works with arrayFormat comma'
608+ ) ;
609+
598610 st . end ( ) ;
599611 } ) ;
600612
You can’t perform that action at this time.
0 commit comments