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.

Marking type period selects always same month

See original GitHub issue

Description

When the markingType is set to period the onDayPress callback always return a day on the default month and automatically switches to default month even if no onDayPress is passed in properties

Expected Behavior

The callback should return the current selected date, as when any other markingType is set

https://user-images.githubusercontent.com/31360984/157355609-7f10f40a-81e7-454c-8368-acab936976ea.mp4

Observed Behavior

https://user-images.githubusercontent.com/31360984/157355592-8006a91b-7ff3-46b8-b939-e72b06ae685e.mp4

Environment

  • npm ls react-native-calendars: react-native-calendars@1.1279.0
  • npm ls react-native: react-native@0.64.3

Also specify:

  1. Device/emulator/simulator & OS version:

Emulator: Pixel_2_API_29 Device: Redmi Note 7 Android 10

Reproducible Demo

export default function App() {
  const [show, setShow] = useState(false);
  const [selectedDate, setSelectedDate] = useState("");
  return (
    <View>
      <Calendar
        onDayPress={(data) => {
          console.log(data);
          setSelectedDate(data.dateString);
        }}
        markingType="period"
      />
      <Text>{selectedDate}</Text>
    </View>
  );
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:10

github_iconTop GitHub Comments

3reactions
ilaloovcommented, Mar 11, 2022

I have the same issue with the most recent release (1.1279.0). The issue does not occur in 1.1278.0.

  • react-native-calendars: 1.1279.0
  • react-native: 0.64.3

Testing on physical device with iOS 15.3.1

2reactions
eramudeepcommented, Mar 14, 2022

I have the same issue with the most recent release (1.1279.0). The issue does not occur in 1.1278.0.

  • react-native-calendars: 1.1279.0
  • react-native: 0.64.3

Testing on physical device with iOS 15.3.1

yes, i was also facing the same issue. then switch back to version 1.1276.0 and start working. seems like many things are broken in the latest version. or the documentation is not upto date.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use conditional formatting to give your calendar a visual refresh
Use conditional formatting to give your calendar a visual refresh · From your Calendar folder, select View > View Settings. · Select Conditional...
Read more >
Excel conditional formatting for dates & time: formulas and rules
Select one of the date options from the drop-down list in the left-hand part of the window, ranging from last month to next...
Read more >
Calendar marking react-native-calendars - Stack Overflow
Currently when I click a date nothing happens. I'm guessing I'm supposed to detect a click and change the markedDates dict accordingly, but...
Read more >
Create customized and shareable calendars in React Native
Want to display a quick summary of a few bookings in a calendar? Try the multi-period marking type. Customizing the calendar theme. Now,...
Read more >
<input type="date"> - HTML: HyperText Markup Language
The second problem is the more serious one; with date input supported, the value is normalized to the format yyyy-mm-dd . But with...
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