rjsf-team/react-jsonschema-form

AntDesign date time picker does not work

Fechada

#4.305 aberto em 17 de set. de 2024

 (5 comentários) (0 reação) (1 responsável)TypeScript (2.136 forks)batch import
antdbughelp wanted

Métricas do repositório

Stars
 (13.175 estrelas)
Métricas de merge de PR
 (Mesclagem média 3d 17h) (32 fundiu PRs em 30d)

Description

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

Guia do colaborador