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

cant select only one day in range selection #396

Open
Bludecoder2 opened this issue Sep 10, 2024 · 5 comments
Open

cant select only one day in range selection #396

Bludecoder2 opened this issue Sep 10, 2024 · 5 comments

Comments

@Bludecoder2
Copy link

In an older version of react I could select the same day twice in the range selection. That would allow me to select a range of one day.
Now I can't do that anymore.

thats how I implement the range selection:

<CalendarPicker
            onDateChange={onDateChange}
            selectedStartDate={isDateStartChange}
            minRangeDuration={0}
            maxRangeDuration={14}
            selectedEndDate={isDateEndChange}
            allowRangeSelection={true}
            selectedRangeStyle={{
              backgroundColor: "#ec672f",
              color: "white",
            }}
            firstDay={1}
            todayBackgroundColor={"#d1cdc0"}
            selectYearTitle={"Jahr auswählen"}
            selectMonthTitle={"Monat auswählen "}
            selectedDayStyle={{
              borderWidth: 0,
              color: "white",
              borderColor: "#11322e",
              backgroundColor: "#ec672f",
            }}
            weekdays={["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"]}
            months={["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]}
            nextComponent={<Icon name="arrow-right-bold" color="#ec672f" type="material-community" style={{ marginRight: 10 }} />}
            previousComponent={<Icon name="arrow-left-bold" color="#ec672f" type="material-community" style={{ marginLeft: 10 }} />}
          />

Anyone any idea why its broken or better how to fix it?

@Bludecoder2
Copy link
Author

I am using version 7.1.3 of the plugin but also the newest version does not work. React I am on version 18.3.1

@Bludecoder2
Copy link
Author

The problem was solved by enabling backwards selection

@davidfeldt
Copy link

Is there any solution for this? The older version allowed start date and end date to be the same date. Now, it doesn't allow for single date range. I don't understand what @Bludecoder2 means by the problem was solved by enabling backwards selection?

@stephenrichard
Copy link

stephenrichard commented Oct 31, 2024

Is there any solution for this? The older version allowed start date and end date to be the same date. Now, it doesn't allow for single date range. I don't understand what @Bludecoder2 means by the problem was solved by enabling backwards selection?

@davidfeldt
I faced the same issue unable to select only one day in range selection.
If you enable the allowBackwardRangeSelect={true} (that's probably what @Bludecoder2 meant by saying enabling backwards selection) props it seems to allow us to get a value for the "end" date instead of null when clicking on the same day.
If it's possible for you, it should solve the issue.

@davidfeldt
Copy link

davidfeldt commented Oct 31, 2024 via email

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

3 participants