rjsf-team/react-jsonschema-form

AntDesign date time picker does not work

Chiusa

#4305 aperta il 17 set 2024

 (5 commenti) (0 reazioni) (1 assegnatario)TypeScript (2136 fork)batch import
antdbughelp wanted

Metriche repository

Star
 (13.175 stelle)
Metriche merge PR
 (Merge medio 3g 17h) (32 PR mergiate in 30 g)

Descrizione

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

Guida contributor