rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.
https://rjsf-team.github.io/react-jsonschema-form/
Apache License 2.0
14.14k stars 2.18k forks source link

AntDesign date time picker does not work #4305

Open troos18 opened 5 days ago

troos18 commented 5 days ago

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

heath-freenome commented 2 days ago

@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?