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

[DatePicker2] disabledDate无效 #3877

Closed
cwtuan opened this issue Apr 27, 2022 · 5 comments · Fixed by #4711
Closed

[DatePicker2] disabledDate无效 #3877

cwtuan opened this issue Apr 27, 2022 · 5 comments · Fixed by #4711
Assignees
Labels
🐞 Bug Something isn't working Next release issues to close in next release

Comments

@cwtuan
Copy link
Contributor

cwtuan commented Apr 27, 2022

Component

DatePicker2

Reproduction link

https://o2.alibaba-inc.com/sandbox/ide?id=183

import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
const mountNode = document.getElementById("root");
import { DatePicker2 } from '@alifd/next';
import dayjs from 'dayjs';

const { RangePicker, MonthPicker, YearPicker } = DatePicker2;
const currentDate = dayjs();

const disabledDate = function (date, mode) {
    console.log('aaa disabledDate',date, mode)
    return currentDate.date() != date.date();
};

ReactDOM.render(<div>
    <RangePicker 
    showTime
          timePanelProps={{ format: "HH:mm" }}
    disabledDate={disabledDate} onChange={val => console.log(val)} /><br /><br />
</div>, mountNode);

Steps to reproduce

  1. 选择今天日期、时间,按下确定
    image

  2. 点击上方"结束日期"输入框,直接选择右边"时间"
    image

  3. 原本28号是不能选的,但是却自动选上了
    image

@lakerswgq lakerswgq self-assigned this Apr 27, 2022
@lakerswgq
Copy link
Contributor

endDate 的默认值是明天,造成 disabledDate 的日期被选中了

@cwtuan
Copy link
Contributor Author

cwtuan commented Apr 27, 2022

@lakerswgq 有预计修复日期吗

@lakerswgq
Copy link
Contributor

@lakerswgq 有预计修复日期吗

修复方案是将默认 endDate 设置为和 startDate 一致,设计师需要修改交互,等交互方案产出后评估开发时间。目前暂无确切修复日期,之后进展会在 issue 同步。

@cwtuan
Copy link
Contributor Author

cwtuan commented May 5, 2022

@lakerswgq
或者简单一点,当日期没选择时,禁止选择时间

@cwtuan
Copy link
Contributor Author

cwtuan commented May 11, 2022

"修复方案是将默认 endDate 设置为和 startDate 一致" => 这个还需要有新的交互吗?

@YunMeng99 YunMeng99 added the 🐞 Bug Something isn't working label Aug 11, 2023
@YSMJ1994 YSMJ1994 added the Next release issues to close in next release label Nov 30, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in DAILY WORK Nov 30, 2023
@YSMJ1994 YSMJ1994 assigned seven-lh and unassigned lakerswgq Nov 30, 2023
@seven-lh seven-lh moved this from 🆕 New to 🏗 In progress in DAILY WORK Dec 6, 2023
@seven-lh seven-lh moved this from 🏗 In progress to 🔖 Ready in DAILY WORK Dec 8, 2023
@YSMJ1994 YSMJ1994 moved this from 🔖 Ready to 📋 Backlog in DAILY WORK Dec 13, 2023
@seven-lh seven-lh linked a pull request Dec 13, 2023 that will close this issue
@seven-lh seven-lh moved this from 📋 Backlog to 🏗 In progress in DAILY WORK Jan 10, 2024
@seven-lh seven-lh moved this from 🏗 In progress to 👀 In review in DAILY WORK Jan 10, 2024
YSMJ1994 pushed a commit that referenced this issue Jan 10, 2024
…3877 (#4711)

* fix(DatePicker2): [DatePicker2] remove default range 24hr,close #3877

* fix(DatePicker2): [DatePicker2] update test,close #3877

---------

Co-authored-by: lancely <[email protected]>
@github-project-automation github-project-automation bot moved this from 👀 In review to Ready to release in DAILY WORK Jan 10, 2024
@YSMJ1994 YSMJ1994 moved this from Ready to release to ✅ Done in DAILY WORK Jan 15, 2024
eternalsky pushed a commit that referenced this issue Jul 16, 2024
…3877 (#4711)

* fix(DatePicker2): [DatePicker2] remove default range 24hr,close #3877

* fix(DatePicker2): [DatePicker2] update test,close #3877

---------

Co-authored-by: lancely <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working Next release issues to close in next release
Projects
Archived in project
5 participants