huybuidac / shadcn-datetime-picker

Shadcn datetime picker supports timezone, min date, max date
https://shadcn-datetime-picker-pro.vercel.app
56 stars 6 forks source link

Error when trying to hide seconds #1

Closed djshubs closed 6 days ago

djshubs commented 4 weeks ago

Here's my component:

 <DateTimePicker
                        value={field.value ?? new Date()}
                        onChange={(date) => {
                          field.onChange(date);
                          field.onBlur();
                        }}
                        timezone={session.timeZone || "UTC"}
                        timePicker={{
                          second: false,
                        }}
                      />

Here's the error I'm getting:

CleanShot 2024-10-31 at 11 57 03@2x

huybuidac commented 4 weeks ago

@djshubs You should set both hour and minute to true instead.

timePicker={{
  hour: true,
  minute: true
}}

https://shadcn-datetime-picker-pro.vercel.app/?path=/story/datetimepicker--date-time-input-picker