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 控件手动输入合法日期后调用 format 格式化报错 #25

Closed
life88 opened this issue May 4, 2020 · 3 comments · Fixed by iamkun/dayjs#896

Comments

@life88
Copy link

life88 commented May 4, 2020

function App() {
  const onChange = (value) => {
    console.log(value);
    console.log(value && value.format('YYYY-MM-DD'));
  };

  return (
    <div className="App">
      <div>antd version: {version}</div>
      <div>
        <DatePicker onChange={onChange} />
      </div>
      <Button type='primary'>按钮</Button>
    </div>
  );
}

手动输入合法值后 onChange 中的第二个 console.log 会报错

20200504160706

@iamkun
Copy link
Collaborator

iamkun commented May 4, 2020

可以提供一个可复现的 repo 吗

@life88
Copy link
Author

life88 commented May 4, 2020

手动输入合法日期,不要通过 DatePicker 选择即可复现
antd-demo.zip

@iamkun
Copy link
Collaborator

iamkun commented May 6, 2020

确认是解析日期时的 bug 将在下个版本修复

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.

2 participants