File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -588,8 +588,9 @@ function $UrlMatcherFactory() {
588
588
} ,
589
589
date : {
590
590
encode : function ( val ) {
591
- return [
592
- val . getFullYear ( ) ,
591
+ if ( ! this . is ( val ) )
592
+ return undefined ;
593
+ return [ val . getFullYear ( ) ,
593
594
( '0' + ( val . getMonth ( ) + 1 ) ) . slice ( - 2 ) ,
594
595
( '0' + val . getDate ( ) ) . slice ( - 2 )
595
596
] . join ( "-" ) ;
@@ -600,7 +601,7 @@ function $UrlMatcherFactory() {
600
601
return match ? new Date ( match [ 1 ] , match [ 2 ] - 1 , match [ 3 ] ) : undefined ;
601
602
} ,
602
603
is : function ( val ) { return val instanceof Date && ! isNaN ( val . valueOf ( ) ) ; } ,
603
- equals : function ( a , b ) { return a . toISOString ( ) === b . toISOString ( ) ; } ,
604
+ equals : function ( a , b ) { return this . is ( a ) && this . is ( b ) && a . toISOString ( ) === b . toISOString ( ) ; } ,
604
605
pattern : / [ 0 - 9 ] { 4 } - (?: 0 [ 1 - 9 ] | 1 [ 0 - 2 ] ) - (?: 0 [ 1 - 9 ] | [ 1 - 2 ] [ 0 - 9 ] | 3 [ 0 - 1 ] ) / ,
605
606
capture : / ( [ 0 - 9 ] { 4 } ) - ( 0 [ 1 - 9 ] | 1 [ 0 - 2 ] ) - ( 0 [ 1 - 9 ] | [ 1 - 2 ] [ 0 - 9 ] | 3 [ 0 - 1 ] ) /
606
607
} ,
You can’t perform that action at this time.
0 commit comments