11import * as React from 'react' ;
22import classNames from 'classnames' ;
33import PanelContext from '../PanelContext' ;
4+ import { GenerateConfig } from '../generate' ;
5+ import { getLastDay } from '../utils/timeUtil' ;
46
57export interface PanelBodyProps < DateType > {
68 prefixCls : string ;
@@ -17,6 +19,7 @@ export interface PanelBodyProps<DateType> {
1719 getCellText : ( date : DateType ) => React . ReactNode ;
1820 getCellNode ?: ( date : DateType ) => React . ReactNode ;
1921 titleCell ?: ( date : DateType ) => string ;
22+ generateConfig : GenerateConfig < DateType > ;
2023
2124 // Used for week panel
2225 prefixColumn ?: ( date : DateType ) => React . ReactNode ;
@@ -36,6 +39,7 @@ export default function PanelBody<DateType>({
3639 getCellText,
3740 getCellNode,
3841 getCellDate,
42+ generateConfig,
3943 titleCell,
4044 headerCells,
4145} : PanelBodyProps < DateType > ) {
@@ -63,12 +67,16 @@ export default function PanelBody<DateType>({
6367 }
6468 }
6569
70+ const title = titleCell && titleCell ( currentDate ) ;
71+
6672 row . push (
6773 < td
6874 key = { j }
69- title = { titleCell && titleCell ( currentDate ) }
75+ title = { title }
7076 className = { classNames ( cellPrefixCls , {
7177 [ `${ cellPrefixCls } -disabled` ] : disabled ,
78+ [ `${ cellPrefixCls } -start` ] : getCellText ( currentDate ) === 1 ,
79+ [ `${ cellPrefixCls } -end` ] : title === getLastDay ( generateConfig , currentDate ) ,
7280 ...getCellClassName ( currentDate ) ,
7381 } ) }
7482 onClick = { ( ) => {
0 commit comments