Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - DatePicker calanderProps classnames not working #3769

Closed
siinghd opened this issue Sep 16, 2024 · 3 comments · Fixed by #3773
Closed

[BUG] - DatePicker calanderProps classnames not working #3769

siinghd opened this issue Sep 16, 2024 · 3 comments · Fixed by #3773
Assignees
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working

Comments

@siinghd
Copy link

siinghd commented Sep 16, 2024

NextUI Version

@nextui-org/date-picker@^2.1.6

Describe the bug

I'm trying to style the calender using calenderProps within datepicker but it's not working as they are not taking affect:

Here is a simple example

<DatePicker
                  size="lg"
                  showMonthAndYearPickers
                  calendarProps={{
                    classNames: {
                      grid: 'bg-red-800',
                    },
                  }}
                  className="max-w-full rounded-xl"
                  classNames={{
                    label: 'text-tertiary !text-body-regular',
                    input: '!text-body-regular text-gray-text ',
                    calendar: ' rounded-xl text-tertiary',
                    calendarContent: ['rounded-xl'],
                    popoverContent: ['border-2 border-gray-text rounded-xl'],
                    inputWrapper: [
                      'border-2 border-gray-text rounded-xl data-[focus=true]:border-gray-text group-data-[focus=true]:border-tertiary',
                    ],
                  }}
                  dateInputClassNames={{
                    label: 'text-tertiary !text-body-regular',
                    input: '!text-body-regular text-gray-text',
                    inputWrapper: [
                      'border-2 border-gray-text rounded-xl data-[focus=true]:border-tertiary group-data-[focus=true]:border-tertiary',
                    ],
                  }}
                  label="Start date"
                  value={startDate ? parseDate(startDate) : undefined}
                  onChange={(date) =>
                    handleCustomDateChange(date.toString(), true)
                  }
                />

If i do use

<Calender classNames={{ grid: 'bg-red-800',}}/>

this works fine.


In datePicker even if i try to find the class bg-red-800 i can't find it.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Inatall the datePicker component @nextui-org/date-picker
Use it, add pass calanderProps with classNames.

Expected behavior

classNames inside calanderProps should be applied as they are applied using the calander

Screenshots or Videos

No response

Operating System Version

MacOS

Browser

Chrome

Copy link

linear bot commented Sep 16, 2024

@macci001
Copy link
Contributor

Seems like the calendarProps are not propagated correctly to the calendar. Can I work on this @wingkwong?

@wingkwong
Copy link
Member

@macci001 go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants