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.

In CalendarListComponent, I'm not able to open the calendar to a specific date.

See original GitHub issue

Description

In CalendarListComponent if I use the “current” parameter, the calendar doesn’t open to the current date, there’s some height issue. In CalendarListComponent if I use “initialDate” parameter all the month names come same.

Expected Behavior

In CalendarListComponent, I should be able to open the calendar to a specific date.

Observed Behavior

If I use “current”

https://user-images.githubusercontent.com/66520288/176000448-23361ed8-a0b0-4b75-b30f-addbfd3e9250.mp4

If I use “initialDate”

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-calendars: react-native-calendars@1.1284.0
  • npm ls react-native: “0.66.4”,

Also specify:

  1. Device/emulator/simulator & OS version:

Simulator iPhone 13; 15.2

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
ruslan-akhmcommented, Aug 5, 2022

Okay I seem to have found how to fix it. I am on version 1.1275.0 and I am not sure if the fix is going to work on other versions. So what I did is:

  1. go to node_modules/react-native-calendars/src/calendar-list/index.js and on line 85 update “date” definition by adding parseDate(props.initialDate) || in front, so it should look like this: image

  2. In your component wrap CalendarList in curly braces and add condition to only render when there is value for initialDate. If you are using constant value (hardcoded), then you should not need this. My code looks like this: image

Try if this works for you @emreyeter @tormodAase

0reactions
Yuliia143commented, Oct 31, 2022

Have the same issue 😟

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a calendar view from a list - Microsoft Support
Make a calendar based on list data in either the Microsoft Lists app or SharePoint in Microsoft 365. You just need a list...
Read more >
Use a screen reader with Google Calendar
To change the view to a specific date, use the 'Go to date' shortcut: Go to calendar.google.com. To open the 'Go to date'...
Read more >
Google calendar not loading? Here is how to fix it. - TimeTackle
Go to settings, select “Date and Time” and make sure that “Automatic date and time” is turned on. Step by step instructions: Go...
Read more >
Class CalendarApp | Apps Script - Google Developers
This class provides direct access to the user's default calendar, ... If no time zone is specified, the time values are interpreted in...
Read more >
Go to specific dates or change views in Calendar on Mac
In Calendar on your Mac, go to today's date or a specific date or switch between day, week, month, or year views using...
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