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

Question: View only mode for react-date-range? #613

Open
jasonsrogers opened this issue Jul 10, 2023 · 0 comments
Open

Question: View only mode for react-date-range? #613

jasonsrogers opened this issue Jul 10, 2023 · 0 comments

Comments

@jasonsrogers
Copy link

Hi all

I'm looking for a way to use react-date-range in display only mode:

  • no inputs
  • no calendar selection
  • no change event

The goal is to be able to show ranges on the calendar without allowing changes to it. (Some users have sets the ranges, some users can only view them)

So far I've managed to:

  • disable the inputs
  • hide the preview on hover
  • not respond to selection
<DateRange
        ranges={[state.selection1, state.selection2, state.selection3]}
        editableDateInputs={false}
        showPreview={false}
        onChange={()=>{}}
        rangeColors={["#FFB800", "#B8FF00", "#B800FF"]}
      />

Then I can do some css hacking:

.rdrDateDisplayWrapper {
   display: none; 
}
// etc

Is there a better way ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant