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.

renderMonthText prop makes the calendar invisible

See original GitHub issue

react-dates version react-dates@21.8.0

Describe the bug I need the Jalali calendar instead of Gregorian, so based on docs and examples, I came up with the following configuration.

The calendar works perfectly without renderMonthText prop. renderMonthText prop makes the calendar view invisible as you see on the preview below.

Source code (including props configuration)

<DayPickerSingleDateController
  isRTL
  renderMonthText={(month) =>
    momentJalaali(month).format('jMMMM jYYYY')
  }
  renderDayContents={(day) => momentJalaali(day).format('jD')}
/>

Screenshots/Gifs screen-capture

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Google Chrome
  • Version 81.0.4044.138

Is the issue reproducible in Storybook? https://codesandbox.io/s/purple-glade-wb9rx?file=/src/App.js

Additional context I saw this behavior before with DateRangePicker. In that case, renderMonthText prop makes calendars invisible too.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
mmarkelovcommented, May 15, 2020

@meness as workaround it should work with renderMonthElement

<DayPickerSingleDateController
  isRTL
  renderMonthElement={({month}) =>
    momentJalaali(month).format('jMMMM jYYYY')
  }
  renderDayContents={(day) => momentJalaali(day).format('jD')}
/>
1reaction
mmarkelovcommented, Oct 22, 2020

@meness it was not published yet

Read more comments on GitHub >

github_iconTop Results From Across the Web

renderMonthText prop makes the calendar invisible #1993
The calendar works perfectly without renderMonthText prop. renderMonthText prop makes the calendar view invisible as you see on the preview ...
Read more >
react-dates-gte-react-17-21.8.0-version-fixed - npm package
If you supply essential props to each component, ... is focused as well as calendar visibility (the calendar is only visible if focusedInput ......
Read more >
Storybook
Navigate forward to interact with the calendar and select a date. Press the question mark key to get the keyboard shortcuts for changing...
Read more >
useCalendar – React Aria - React Spectrum Libraries
A description of the visible date range, for use in the calendar title. useCalendarGrid#. useCalendarGrid returns props for an individual grid of dates,...
Read more >
mirai-react-dates/CHANGELOG.md - UNPKG
7, - [fix] Removed calculates to position dropdown calendar. ... 262, - [fix] Fix issue where range does not clear on invisible months ......
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