Skip to content

Commit

Permalink
fix: decade panr
Browse files Browse the repository at this point in the history
  • Loading branch information
kerm1it committed Dec 20, 2020
1 parent b7c3ca1 commit b4a4f38
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/panels/DecadePanel/DecadeBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface YearBodyProps<DateType> {

function DecadeBody<DateType>(props: YearBodyProps<DateType>) {
const DECADE_UNIT_DIFF_DES = DECADE_UNIT_DIFF - 1;
const { prefixCls, viewDate, generateConfig, disabledDate } = props;
const { prefixCls, viewDate, generateConfig } = props;

const cellPrefixCls = `${prefixCls}-cell`;

Expand All @@ -35,13 +35,10 @@ function DecadeBody<DateType>(props: YearBodyProps<DateType>) {
);

const getCellClassName = (date: DateType) => {
const disabled = disabledDate && disabledDate(date);

const startDecadeNumber = generateConfig.getYear(date);
const endDecadeNumber = startDecadeNumber + DECADE_UNIT_DIFF_DES;

return {
[`${cellPrefixCls}-disabled`]: disabled,
[`${cellPrefixCls}-in-view`]:
startDecadeYear <= startDecadeNumber && endDecadeNumber <= endDecadeYear,
[`${cellPrefixCls}-selected`]: startDecadeNumber === decadeYearNumber,
Expand Down

0 comments on commit b4a4f38

Please sign in to comment.