Skip to content

Commit

Permalink
chore: fix cal logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Mar 7, 2023
1 parent 11f0acc commit 664b8cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions docs/examples/range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default () => {
<div style={{ display: 'flex', flexWrap: 'wrap' }}>
<div style={{ margin: '0 8px' }}>
<h3>Basic</h3>
<RangePicker<Moment>
{/* <RangePicker<Moment>
{...sharedProps}
value={undefined}
locale={zhCN}
Expand All @@ -62,7 +62,7 @@ export default () => {
defaultValue={[moment('1990-09-03'), moment('1989-11-28')]}
clearIcon={<span>X</span>}
suffixIcon={<span>O</span>}
/>
/> */}
<RangePicker<Moment>
{...sharedProps}
locale={zhCN}
Expand All @@ -77,7 +77,7 @@ export default () => {
console.log('OK!!!', dates);
}}
/>
<RangePicker<Moment>
{/* <RangePicker<Moment>
{...sharedProps}
value={undefined}
locale={zhCN}
Expand All @@ -94,10 +94,10 @@ export default () => {
allowClear
picker="time"
style={{ width: 280 }}
/>
/> */}
</div>

<div style={{ margin: '0 8px' }}>
{/* <div style={{ margin: '0 8px' }}>
<h3>Focus</h3>
<RangePicker<Moment>
{...sharedProps}
Expand Down Expand Up @@ -185,7 +185,7 @@ export default () => {
placeholder={['start...', 'end...']}
disabledDate={disabledDate}
/>
</div>
</div> */}
</div>
</div>
);
Expand Down
12 changes: 6 additions & 6 deletions src/RangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -894,13 +894,13 @@ function InnerRangePicker<DateType>(props: RangePickerProps<DateType>) {
? arrowRef.current.offsetLeft - arrowLeft
: arrowRef.current.offsetLeft;

const panelWidth = panelDivRef.current.offsetWidth;
const arrowWidth = arrowRef.current.offsetWidth;

if (
panelDivRef.current.offsetWidth !== undefined &&
arrowRef.current.offsetWidth !== undefined &&
arrowLeft >
panelDivRef.current.offsetWidth -
arrowRef.current.offsetWidth -
(direction === 'rtl' ? 0 : arrowMarginLeft)
panelWidth &&
arrowWidth &&
arrowLeft > panelWidth - arrowWidth - (direction === 'rtl' ? 0 : arrowMarginLeft)
) {
panelLeft = arrowLeft;
}
Expand Down

0 comments on commit 664b8cf

Please sign in to comment.