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 doesn't respect its height

See original GitHub issue

Hi There, I am using the calendar in my app, I am setting the height on its style as the doc shows, but it doesn’t seem to get it applied.

Expected Behavior

What action did you perform, and what did you expect to happen? I set Calendar height, border and etc on ‘style’ prop. I expected that when playing with height on style prop, it would affect numbers container and fit them into the previous height.

What actually happened when you performed the above actions? It doesn’t respect the defined height on smaller resolution, such as iphone SE. Have changed the height multiple times, it changes the height of the are with gray border, but the numbers container doesn’t have its height affected. (see on attached screenshot)

Environment

  • npm ls react-native-calendars: react-native-calendars@1.1249.0
  • npm ls react-native: react-native@0.63.4

Also specify:

  1. Phone/emulator/simulator & version: iphone SE (2nd generation), nexus One and Pixel_3a.

Reproducible Demo

<SafeAreaView>
            <Calendar
                // Specify style for calendar container element. Default = {}
                style={{
                    borderWidth: 5,
                    borderColor: 'gray',
                    height: 100
                }}
                // Specify theme properties to override specific styles for calendar parts. Default = {}
                theme={{
                    backgroundColor: '#ffffff',
                    calendarBackground: '#ffffff',
                    textSectionTitleColor: '#b6c1cd',
                    textSectionTitleDisabledColor: '#d9e1e8',
                    selectedDayBackgroundColor: '#00adf5',
                    selectedDayTextColor: '#ffffff',
                    todayTextColor: '#00adf5',
                    dayTextColor: '#2d4150',
                    textDisabledColor: '#d9e1e8',
                    dotColor: '#00adf5',
                    selectedDotColor: '#ffffff',
                    arrowColor: 'orange',
                    disabledArrowColor: '#d9e1e8',
                    monthTextColor: 'blue',
                    indicatorColor: 'blue',
                    textDayFontFamily: 'Montserrat-Bold',
                    textMonthFontFamily: 'Montserrat-Bold',
                    textDayHeaderFontFamily: 'Montserrat-Bold',
                    textDayFontWeight: '300',
                    textMonthFontWeight: 'bold',
                    textDayHeaderFontWeight: '300',
                    textDayFontSize: 16,
                    textMonthFontSize: 16,
                    textDayHeaderFontSize: 16
                }}
                />
        </SafeAreaView>
Screen Shot 2021-02-18 at 11 36 49 AM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

2reactions
sperardtcommented, Feb 23, 2021

Found the solution.

I needed to override a couple of styles on the following files: https://github.com/wix/react-native-calendars/blob/master/src/calendar/day/period/style.js

https://github.com/wix/react-native-calendars/blob/master/src/calendar/header/style.js

Basically, on header needed to reduce the font size. If using period, you also will need to play with fontSizes and period height because it is hardcoded on 34.

1reaction
DavidInojosacommented, Sep 9, 2021

same issue here

Read more comments on GitHub >

github_iconTop Results From Across the Web

What to do if Someone Won't Respect Your Online Calendar
Common Calendar Disruptions​​ The first step is to understand what calendar disrespectfulness looks like. I've found that it's generally a matter ...
Read more >
FullCalendar parent height not working in flex layout
In the following code, the calendar does not seem to respect the height of the main section. It appears to be the height...
Read more >
Respect Yourself and Take Back Control of Your Calendar
Behance Blog | Do you struggle with saying, "No"? Four tactics for establishing—and maintaining—boundaries.
Read more >
The Seasons, the Equinox, and the Solstices
Seasons are caused by the fact that the Earth is tilted on its axis by 23.5°. The tilt's orientation with respect to space...
Read more >
Calendar Blocks - Squarespace Help Center
Use calendar blocks to create calendars that display events from events pages in ... The height of the week expands automatically to display ......
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