Skip to content

[pickers] Add support for @js-joda/core #4703

@MMauro94

Description

@MMauro94
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

Currently when using a DatePicker in MUI v5 with JsJodaAdapter (from @date-io/js-joda) an uncaught exception is thrown when changing date. The exception is: DateTimeException: Unable to obtain LocalTime TemporalAccessor: 2021-10-06, type LocalDate.

Expected Behavior 🤔

The picker does not crash and the new value is passed to the onChange function.

Steps to Reproduce 🕹

<LocalizationProvider dateAdapter={JsJodaAdapter}>
  <DatePicker
    value={LocalDate.of(2021, 10, 6)}
    onChange={(d) => console.log(d)}
    renderInput={(p) => <TextField {...p} />}
  />
</LocalizationProvider>

Sandbox link

Context 🔦

The curlpit seems to be on this line, when calling utils.mergeDateAndTime

Your Environment 🌎

`npx @mui/envinfo`
  System:
    OS: Windows 10 10.0.19043
  Binaries:
    Node: 14.17.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.1023.0), Chromium (94.0.992.38)

Don't know why it doesn't get detected, but I'm using Chrome 94.0.4606.71

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: pickersChanges related to the date/time pickers.type: new featureExpand the scope of the product to solve a new problem.waiting for 👍Waiting for upvotes. Open for community feedback and needs more interest to be worked on.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions