File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,10 @@ export const parseAsBoolean = createParser({
196
196
serialize : v => ( v ? 'true' : 'false' )
197
197
} )
198
198
199
+ function compareDates ( a : Date , b : Date ) {
200
+ return a . valueOf ( ) === b . valueOf ( )
201
+ }
202
+
199
203
/**
200
204
* Querystring encoded as the number of milliseconds since epoch,
201
205
* and returned as a Date object.
@@ -208,7 +212,8 @@ export const parseAsTimestamp = createParser({
208
212
}
209
213
return new Date ( ms )
210
214
} ,
211
- serialize : ( v : Date ) => v . valueOf ( ) . toString ( )
215
+ serialize : ( v : Date ) => v . valueOf ( ) . toString ( ) ,
216
+ eq : compareDates
212
217
} )
213
218
214
219
/**
@@ -223,7 +228,8 @@ export const parseAsIsoDateTime = createParser({
223
228
}
224
229
return date
225
230
} ,
226
- serialize : ( v : Date ) => v . toISOString ( )
231
+ serialize : ( v : Date ) => v . toISOString ( ) ,
232
+ eq : compareDates
227
233
} )
228
234
229
235
/**
@@ -242,7 +248,8 @@ export const parseAsIsoDate = createParser({
242
248
}
243
249
return date
244
250
} ,
245
- serialize : ( v : Date ) => v . toISOString ( ) . slice ( 0 , 10 )
251
+ serialize : ( v : Date ) => v . toISOString ( ) . slice ( 0 , 10 ) ,
252
+ eq : compareDates
246
253
} )
247
254
248
255
/**
You can’t perform that action at this time.
0 commit comments