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

🐛[BUG] 弹窗表单, RangePicker不能给初始值. 给了以后就报错 #8399

Open
hhniao opened this issue May 9, 2024 · 3 comments
Open

Comments

@hhniao
Copy link

hhniao commented May 9, 2024

上次遇到该问题#8293, 按照大佬指示填单价参数dateFormatter={false}

尝试解决问题

npm cache clean --force
npm install

🐛 bug 描述

不给初始值, 就没有问题. 给了以后就会报错

  const initValues: FormProps = {
    ...current,
    dateRange: [
        dayjs("2023/01/01"),
        dayjs("2023/01/02"),
    ]
  }

      <DrawerForm<FormProps>
        initialValues={initValues}
        dateFormatter={false}
        onFinish={async (values) => {
          console.log(values)
          console.log(values.dateRange[0].format("YYYY-MM-DD"))
        }}
       >
          <Form.Item
            name={"dateRange]}
            label={i18n.t("date range")}
            hasFeedback
          >
            <RangePicker/>
          </Form.Item>
      </DrawerForm>

📷 复现步骤

无法复现, 本地始终不行,沙箱环境没有问题
https://codesandbox.io/p/sandbox/antd-rangepicker-hrpfgh?file=%2Fsrc%2FApp.tsx%3A18%2C82

💻 复现代码

无法复现

🚑 其他信息

1715249230511
image
image
image

@hhniao
Copy link
Author

hhniao commented May 10, 2024

@fnoopv 感谢回复.
莫名其妙的好了, 我也不知道怎么回事.

@fnoopv
Copy link
Contributor

fnoopv commented May 10, 2024

刚才回复后感觉有问题,删除了,注意 dayjs 版本

@hhniao
Copy link
Author

hhniao commented May 10, 2024

版本也检查过了, 按照codesanbox能正常运行的版本.
多谢了, 反正现在能运行. 暂时先不管了.

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

No branches or pull requests

2 participants