Skip to content

Commit e858d66

Browse files
authored
chore: add showWeek style (#735)
1 parent b815be3 commit e858d66

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/PickerPanel/DatePanel/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import classNames from 'classnames';
22
import * as React from 'react';
3+
import type { PanelMode, SharedPanelProps } from '../../interface';
34
import {
45
formatValue,
56
getWeekStartDate,
67
isSameDate,
78
isSameMonth,
89
WEEK_DAY_COUNT,
910
} from '../../utils/dateUtil';
10-
import type { PanelMode, SharedPanelProps } from '../../interface';
1111
import { PanelContext, useInfo } from '../context';
1212
import PanelBody from '../PanelBody';
1313
import PanelHeader from '../PanelHeader';
@@ -171,7 +171,7 @@ export default function DatePanel<DateType extends object = any>(props: DatePane
171171
// ========================= Render =========================
172172
return (
173173
<PanelContext.Provider value={info}>
174-
<div className={panelPrefixCls}>
174+
<div className={classNames(panelPrefixCls, showWeek && `${panelPrefixCls}-show-week`)}>
175175
{/* Header */}
176176
<PanelHeader
177177
onOffset={(offset) => {

tests/new-range.spec.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,9 @@ describe('NewPicker.Range', () => {
10331033
openPicker(container);
10341034

10351035
expect(document.querySelector('.rc-picker-cell-week')).toBeTruthy();
1036+
expect(
1037+
document.querySelector('.rc-picker-date-panel.rc-picker-date-panel-show-week'),
1038+
).toBeTruthy();
10361039
});
10371040

10381041
it('focus event', () => {

0 commit comments

Comments
 (0)