Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Datepicker] disabledDate + monthRange does not behave as expected #2567

Open
1 task done
YannLynn opened this issue Nov 13, 2024 · 0 comments · May be fixed by #2569
Open
1 task done

[Datepicker] disabledDate + monthRange does not behave as expected #2567

YannLynn opened this issue Nov 13, 2024 · 0 comments · May be fixed by #2569

Comments

@YannLynn
Copy link
Collaborator

YannLynn commented Nov 13, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Which Component

Datepicker

Semi Version

latest

Current Behavior

20241114110618_rec_

Expected Behavior

20241114110710_rec_

Steps To Reproduce

ReproducibleCode

import React from 'react';
import { DatePicker } from '@douyinfe/semi-ui';

() => {
    const disabledDate = (date) => {
        const deadDate = new Date('2025/3/1 00:00:00');
        const startDate = new Date('2024/11/1 00:00:00');
        return date.getTime() < startDate.getTime() || date.getTime() > deadDate.getTime(); 
    }
    return <DatePicker type="monthRange" style={{ width: 200 }}  disabledDate={disabledDate}/>
};

or for quick preview visit https://codesandbox.io/p/sandbox/red-lake-xl34lg?file=%2Fsrc%2FApp.jsx%3A17%2C44

Environment

- OS:
- browser:

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant