Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.
This repository was archived by the owner on May 19, 2025. It is now read-only.

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

Open
@jasonsrogers

Description

@jasonsrogers

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions