maggialejandro/react-native-calendario

Can i select only 1 Day as range?

Osher671279 opened this issue · 7 comments

Hey,
If i would like to select only 1 day as range, for example:
Im a business owner who open 1 day a week and i want to select only this day, am i able to do this?

Whenever im doing it the selected date is disappear and the app is stuck.

dont know how to change the label im sorry its not a bug

Hi @Osher671279
Could you send a snack or recording of the problem?
You may want to use disableRange prop

Hey Thanks for the fast replay, im attaching a video(Dont be scared from the Hebrew)

https://vimeo.com/463549969 (Tell me if there is a problem)

What i want to do is this:
I want the Range to be enabled, meaning that i can still choose date range but i would like to choose only 1 day if i want to

That's weird
Are you using the latest version?
Could you share a snack or reproduce that behavior on the example app?

My code is bit complicated to add to Snack :( its a whole App
Please mind that if i pick a range its working

Do you have a Discord or WhatsApp that we can talk more directly?

This is the implement of the Range(Working when i choose more then 1 day):
` ```
let end = "";
const start2 = range.startDate;
console.log("=======", range);

let end2 = "";
const start = range.startDate.toString();
if (range.endDate != null) {
  end = range.endDate.toString();
  end2 = range.endDate;
    }`

Calendar:
`  onChange={(range) => {
            setStartEndDates(range);
          }}
          minDate={new Date()}
          startDate={new Date()}
          endDate={new Date()}
          disableOffsetDays={true}
          // disabledDays={DISABLED_DAYS}`
stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale commented

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.