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

AntDesign date time picker does not work #4305

Open
4 tasks done
troos18 opened this issue Sep 17, 2024 · 4 comments
Open
4 tasks done

AntDesign date time picker does not work #4305

troos18 opened this issue Sep 17, 2024 · 4 comments
Labels
antd antd related theme issue bug help wanted

Comments

@troos18
Copy link

troos18 commented Sep 17, 2024

Prerequisites

What theme are you using?

antd

Version

5.20.1

Current Behavior

In my App, I have an issue when trying to edit a date picker field using antd.

Got this log:

moment.js:24 Uncaught TypeError: clone.weekday is not a function
    at Object.getWeekDay (moment.js:24:18)
    at getWeekStartDate (dateUtil.js:101:41)
    at DateBody (DateBody.js:30:83)
    at renderWithHooks (react-dom.development.js:15486:18)
    at mountIndeterminateComponent (react-dom.development.js:20098:13)
    at beginWork (react-dom.development.js:21621:16)
    at HTMLUnknownElement.callCallback (react-dom.development.js:4164:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:16)
    at invokeGuardedCallback (react-dom.development.js:4277:31)
    at beginWork$1 (react-dom.development.js:27485:7)

Expected Behavior

I should be able to edit the field.

Steps To Reproduce

Using your playground with theme=antd

JSON Schema:

{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema",
  "examples": [
    {
      "date": "2024-09-17T03:24:00"
    }
  ],
  "properties": {
    "date": {
      "type": "string",
      "title": "Date",
      "format": "date-time",
      "description": "Date and time"
    }
  }
}

Try to edit the field, nothing happen.

Environment

- OS: macOS M2 14.6.1 & Windows 10 pro 22H2
- Node: 22.8.0
- npm: 10.8.2

Anything else?

No response

@troos18 troos18 added bug needs triage Initial label given, to be assigned correct labels and assigned labels Sep 17, 2024
@heath-freenome heath-freenome added antd antd related theme issue help wanted and removed needs triage Initial label given, to be assigned correct labels and assigned labels Sep 20, 2024
@heath-freenome
Copy link
Member

@troos18 Thanks for the bug report. The issue is also quite visible on our date time page in the playground. As we normally rely on developers to deal with theme specific issues, would you be willing to provide a fix for us?

@troos18
Copy link
Author

troos18 commented Sep 27, 2024

Hello,
Sorry for late answer.
Unfortunately, I can't try to provide a fix for now.
Is there another way to fix this ?

@heath-freenome
Copy link
Member

Likely not. Do you have anyone you work with who may be able to fix it?

@MaximeSauvageD4
Copy link

Hi @heath-freenome, can we have a helping hand on this please?
We've managed to display the popup of the date picker by adding a call to <DatePicker /> from Antd under <DemoFrame /> in react-jsonschema-form/packages/playground/src/components/Playground.tsx. Note that I talk about the popup of the widget.
The popup does not appearwhen the field is focused but does when the user clicks outside of it after. It stays displayed until field is focused again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
antd antd related theme issue bug help wanted
Projects
None yet
Development

No branches or pull requests

3 participants