shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
72.19k stars 4.35k forks source link

[bug]: breaking changes for calendar using react-day-picker 9.1.4 #5417

Open Davidihl opened 1 day ago

Davidihl commented 1 day ago

Describe the bug

As it is, the calendar component breaks, if you update react-day-picker to 9.1.4. I discovered this while I initially wanted to try out the new timeZone feature.

More details on what may be affected are provided in the docs: https://daypicker.dev/upgrading

Styles & custom components are affected.

Example Quote from the migration guide

//Broken
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,

//Fix
Chevron(props) {
  if (props.orientation === 'left') {
    return <ChevronLeft className="h-4 w-4" />;
  }
  return <ChevronRight className="h-4 w-4" />;
},
  }}
  />

Please let me know if you need additional information.

Affected component/components

calendar

How to reproduce

Update react-day-picker from 8.10.1 to 9.1.4

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Windows/Chrome

Before submitting

huybuidac commented 19 hours ago

While waiting for the update, you can try this.

Demo: https://shadcn-datetime-picker-xi.vercel.app/ Repo: https://github.com/huybuidac/shadcn-datetime-picker/tree/main