Skip to content

AntDesign date time picker does not work #4305

@troos18

Description

@troos18

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions