question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calendar does not change when dates are changed via input

See original GitHub issue

As the topic says, the calendar does not switch to the date entered via input box. I have tried it with the demos in storybook: Allow All Days Including Past Days

First enter: 10/25/2019 in startDate image You’ll see it is highlighted in the calendar.

2nd: 10/25/2018 image

3rd: 10/25/2025 image

As you can see in the 2nd and 3rd input, it does not render the calendar on those years. In order to see the change in calendar, you need to enter start and end date and close the calendar. Right now I am using the ff. settings:

<DateRangePicker
        startDateId="startDate"
        endDateId="endDate"
        startDate={start}
        endDate={end}
        daySize={25}
        onDatesChange={({ startDate, endDate }) => {
          setStateStartDate(startDate);
          setStateEndDate(endDate);
        }}
        focusedInput={focusedInput}
        onFocusChange={focused => {
          if (focused) {
            setStatefocusedInput(focused);
          }
        }}
        keepOpenOnDateSelect
        autoFocus={() => true}
        hideKeyboardShortcutsPanel
        noBorder
        isOutsideRange={() => false}
        customArrowIcon={<i className="fa fa-long-arrow-right ml-2" />}
        numberOfMonths={2}
        showDefaultInputIcon
        inputIconPosition="after"
      />

I am using the keepOpenOnDateSelect for UI/UX purposes. Question is: How can I re-render the calendar without closing the calendar itself? Is it possible to re-render the calendar upon finished typing?

Also I think it is a bug when isOutsideRange false, the past dates that were selected aren’t highlighted. They’ll only be highlighted when switching months and they’ll be gone when you focus on the month of the date specified. Found this Past Issue with no solution. Is there any solution now?

The demo isn’t enough to cover all of the props of the datepicker. I hope there will be more examples on how to properly use the props. Thank you very much in advance.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
nitish-aroracommented, Dec 13, 2021

Any progress on this? I want to update the dates from outside of calendar and calendar will always in open state.

When I updated the date from outside of the calendar, calendar remained at that month.

1reaction
pompan129commented, Apr 19, 2020

any progress on this? I’m having the same problem. onDatesChange is called but with null values.

  • Update. my mistake. My issue was happening because the date was an invalid format. and related to issuue #1937
Read more comments on GitHub >

github_iconTop Results From Across the Web

Calendar does not change when dates are changed via input
Any progress on this? I am unable to update the calendar date when I type the date from the input in the SingleDatePicker...
Read more >
BootStrap DatePicker Calendar Input Change Not Updating ...
When the user changes the date by typing directly into the input element, and then clicks the calendar icon, the changed date is...
Read more >
Stop automatically changing numbers to dates
Stop Excel from entering dates automatically by changing numbers to dates. ... This way Excel will not try to change what you enter...
Read more >
If you can't change a calendar or event on Mac - Apple Support
If you can't change an event you created, or you can't change your status for an event you were invited to, it might...
Read more >
Google Sheets Date Picker - An Easy Guide For 2022
All you have to do is double click on a cell with the format set to dates. You can also use Data validation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found