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日期选择框缺陷 #19013

Closed
1 task
wang-qiqi opened this issue Sep 26, 2019 · 2 comments
Closed
1 task

DatePicker日期选择框缺陷 #19013

wang-qiqi opened this issue Sep 26, 2019 · 2 comments
Assignees
Labels
🤔 Need Reproduce We cannot reproduce your problem

Comments

@wang-qiqi
Copy link

wang-qiqi commented Sep 26, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://codesandbox.io/s/antd-reproduction-template-jrctn

Steps to reproduce

最小可复现仓库 运行以下代码,或者访问https://codepen.io/pen/?&editable=true&editors=001示例1

import moment from 'moment';
import { DatePicker } from 'antd';

const { MonthPicker, RangePicker } = DatePicker;

function range(start, end) {
  const result = [];
  for (let i = start; i < end; i  ) {
    result.push(i);
  }
  return result;
}

function disabledDate(current) {
  // Can not select days before today and today
  return current && current < moment().endOf('day');
}

function disabledDateTime() {
  return {
    disabledHours: () => range(0, 24).splice(4, 20),
    disabledMinutes: () => range(30, 60),
    disabledSeconds: () => [55, 56],
  };
}

function disabledRangeTime(_, type) {
  if (type === 'start') {
    return {
      disabledHours: () => range(0, 60).splice(4, 20),
      disabledMinutes: () => range(30, 60),
      disabledSeconds: () => [55, 56],
    };
  }
  return {
    disabledHours: () => range(0, 60).splice(20, 4),
    disabledMinutes: () => range(0, 31),
    disabledSeconds: () => [55, 56],
  };
}

ReactDOM.render(
  <div>
    <DatePicker
      format="YYYY-MM-DD HH:mm:ss"
      disabledDate={disabledDate}
      disabledTime={disabledDateTime}
      showTime={{ defaultValue: moment('00:00:00', 'HH:mm:ss') }}
    />
   
  </div>,
  mountNode,
);

What is expected?

期望鼠标点击9月1号之后,日历的翻页>点击到10月之后,10月1号不是选中的状态;

What is actually happening?

鼠标点击9月1号之后,日历的翻页>点击到10月之后,10月1号是选中的状态

Environment Info
antd 3.23.4
React 16.8.6
System mac os
Browser chrome
@ant-design-bot
Copy link
Contributor

Hello @wang-qiqi. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 7 days.

你好 @wang-qiqi, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。7 天内未跟进的 issue 将会被自动关闭。

@ant-design-bot
Copy link
Contributor

This issue is closed because it has been marked as Need Reproduce, but has not had recent activity.
If you can provide a reproduce, feel free to ping anyone of our maintainers to reopen this issue.
Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem
Projects
None yet
Development

No branches or pull requests

4 participants