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

No way to set styles of selected days in range mode in v9.0 #2218

Closed
punit1108 opened this issue Jun 23, 2024 · 7 comments · Fixed by #2295 or #2294
Closed

No way to set styles of selected days in range mode in v9.0 #2218

punit1108 opened this issue Jun 23, 2024 · 7 comments · Fixed by #2295 or #2294
Assignees

Comments

@punit1108
Copy link

punit1108 commented Jun 23, 2024

Description

Currently there is no way to add properties for range start selected date and end selected date, which might be useful in a lot of scenarios which customizing the range selection.

image

Expected Behavior

There should be a way to style the radiuses of the start and end selected days

Actual Behavior

No styling property currently corresponds to it.

Steps to Reproduce

  1. Set mode as "range"

Possible Solution

Solution 1 -
--rdp-range_start-selected-border-radius
--rdp-range_end-selected-border-radius

Solution 2 -
Add a way to add Tailwind styles apart from the selected property, eg,
range-start-selected
range-end-selected

Screenshots

If applicable, add screenshots or GIFs to help explain your problem.

Your Environment

  • React version: 18
  • Your Timezone: Indian Standard Time
  • Browser [e.g. chrome, safari]:
  • Version [e.g. 22]:
  • Operating System [e.g. iOS, Windows]:macOS
  • Other relevant information:
@punit1108 punit1108 changed the title No way to set border radius of selected days in range mode in v9.0 No way to set styles of selected days in range mode in v9.0 Jun 23, 2024
@gpbl
Copy link
Owner

gpbl commented Jun 24, 2024

Hi @punit1108 thanks for your feedback, it's very important before the release.

First of all, please make sure you use the latest version – as it has been updated recently:

npm install react-day-picker@next

Regarding your question - what are you trying to do? Please be more specific about your issue.

Border radius in stored in by var(--rdp-day_date-border-radius). Maybe something like this would help?

.rdp-selected.rdp-range_start {
   /* set the value here to update the variable when range start: */
   --rdp-day_date-border-radius: 0; 
}

Or:

.rdp-selected.rdp-range_start .rdp-day_date {
  /* here you can override the day date content too */
  border-radius: 0; 
}

@gpbl gpbl added the need more info Lacks enough details to make progress label Jun 24, 2024
@gpbl gpbl closed this as completed Jul 7, 2024
@lariane-guerra
Copy link

Its possible to change in version v8?

image

I need almost this (the second photo its from the playground react day pick):
image

@gpbl
Copy link
Owner

gpbl commented Jul 19, 2024

Hi @lariane-guerra! Here to help...

  • please upgrade to react-day-picker@next if you want to use that style
  • please share some code so we can help. Thanks.

@lariane-guerra
Copy link

Hi, I'll update the version and see.

@lariane-guerra
Copy link

image
I update to the new version,
how i get off this o padding between the days?

@lariane-guerra
Copy link

lariane-guerra commented Jul 22, 2024

import brazilLocale from 'date-fns/locale/pt-BR'

export const NewDatePickerComponent = styled(DayPicker) future styles here

          <NewDatePickerComponent
            locale={brazilLocale}
            mode="range"
            selected={range}
            onSelect={setRange}
            numberOfMonths={1}
          />

locale={brazilLocale}

I found it:
If i remove this, work good, but when i put the brazilocale this what i put in print happen.

@lariane-guerra
Copy link

To add: in playground when you change to pt-BR, bug happen too.

@gpbl gpbl removed the need more info Lacks enough details to make progress label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants