@@ -172,7 +172,8 @@ Component(CalendarDefaultProps, {
172
172
'localeText' ,
173
173
'weekStartsOn' ,
174
174
'onFormatter' ,
175
- ] ) , monthRange = _a [ 0 ] , plocaleText = _a [ 1 ] , pweekStartsOn = _a [ 2 ] , onFormatter = _a [ 3 ] ;
175
+ 'onMonthFormatter' ,
176
+ ] ) , monthRange = _a [ 0 ] , plocaleText = _a [ 1 ] , pweekStartsOn = _a [ 2 ] , onFormatter = _a [ 3 ] , onMonthFormatter = _a [ 4 ] ;
176
177
var localeText = Object . assign ( { } , defaultLocaleText , plocaleText ) ;
177
178
var markItems = __spreadArray ( [ ] , localeText . weekdayNames , true ) ;
178
179
var weekStartsOn = pweekStartsOn ;
@@ -187,7 +188,7 @@ Component(CalendarDefaultProps, {
187
188
if ( onFormatter && typeof onFormatter === 'function' ) {
188
189
cells = cells . map ( function ( o ) {
189
190
var _a ;
190
- var time = o . time , top = o . top , bottom = o . bottom , disabled = o . disabled , isSelectedBegin = o . isSelectedBegin , isSelectedEnd = o . isSelectedEnd , isSelected = o . isSelected ;
191
+ var time = o . time , top = o . top , bottom = o . bottom , disabled = o . disabled , isSelectedBegin = o . isSelectedBegin , isSelectedEnd = o . isSelectedEnd , isSelected = o . isSelected , className = o . className ;
191
192
var newState = ( _a = onFormatter ( {
192
193
time : time ,
193
194
top : top ? __assign ( { } , top ) : undefined ,
@@ -196,11 +197,12 @@ Component(CalendarDefaultProps, {
196
197
isSelectedBegin : isSelectedBegin ,
197
198
isSelectedEnd : isSelectedEnd ,
198
199
isSelected : isSelected ,
200
+ className : className ,
199
201
} , value ) ) !== null && _a !== void 0 ? _a : { } ;
200
202
var result = __assign ( { } , o ) ;
201
203
if ( typeof newState === 'object' ) {
202
- // 只允许修改三个字段
203
- [ 'top' , 'bottom' , 'disabled' ] . forEach ( function ( key ) {
204
+ // 只允许修改的字段字段
205
+ [ 'top' , 'bottom' , 'disabled' , 'className' ] . forEach ( function ( key ) {
204
206
if ( key in newState ) {
205
207
result [ key ] = newState [ key ] ;
206
208
}
@@ -209,10 +211,15 @@ Component(CalendarDefaultProps, {
209
211
return result ;
210
212
} ) ;
211
213
}
212
- return {
214
+ var month = {
213
215
title : p . format ( localeText . title ) ,
216
+ className : '' ,
214
217
cells : cells ,
215
218
} ;
219
+ if ( onMonthFormatter && typeof onMonthFormatter === 'function' ) {
220
+ month = __assign ( __assign ( { } , month ) , onMonthFormatter ( p ) ) ;
221
+ }
222
+ return month ;
216
223
} ) ;
217
224
this . setData ( { markItems : markItems , monthList : monthList } ) ;
218
225
} ,
0 commit comments