@@ -109,6 +109,9 @@ export class CalendarHeaderComponent {
109109 const availValue = (
110110 side === Side . Left ? this . _minAvail : this . _maxAvail
111111 ) ?. clone ( ) ;
112+ if ( ! availValue ) {
113+ return true ;
114+ }
112115 /**
113116 * 对于 range-picker
114117 * 左侧部分 minAvail = minDate, maxAvail = min(maxData, rightAnchor),从而左侧部分的按钮,仅在小于右侧部分时显示
@@ -118,14 +121,14 @@ export class CalendarHeaderComponent {
118121 return type === DateNavRange . Month
119122 ? ! this . anchor . subtract ( 1 , 'month' ) . isBefore ( availValue , 'month' )
120123 : type === DateNavRange . Year
121- ? ! this . anchor . subtract ( 1 , 'year' ) . isBefore ( availValue , 'year' )
122- : false ;
124+ ? ! this . anchor . subtract ( 1 , 'year' ) . isBefore ( availValue , 'year' )
125+ : false ;
123126 }
124127 return type === DateNavRange . Month
125128 ? ! this . anchor . add ( 1 , 'month' ) . isAfter ( availValue , 'month' )
126129 : type === DateNavRange . Year
127- ? ! this . anchor . add ( 1 , 'year' ) . isAfter ( availValue , 'year' )
128- : false ;
130+ ? ! this . anchor . add ( 1 , 'year' ) . isAfter ( availValue , 'year' )
131+ : false ;
129132 }
130133
131134 // @return isBetween|isEqual:0, isBefore:-1,isAfter:1
@@ -141,8 +144,8 @@ export class CalendarHeaderComponent {
141144 return constrainValue . isSame ( range . start , MONTH )
142145 ? 0
143146 : constrainValue . isBefore ( range . start , MONTH )
144- ? - 1
145- : 1 ;
147+ ? - 1
148+ : 1 ;
146149 }
147150
148151 navHead ( range : DateNavRange , value : number ) {
0 commit comments