Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot change the dayContainerStyle height #371

Open
GabrielDvt opened this issue Jul 16, 2023 · 2 comments
Open

Cannot change the dayContainerStyle height #371

GabrielDvt opened this issue Jul 16, 2023 · 2 comments

Comments

@GabrielDvt
Copy link

GabrielDvt commented Jul 16, 2023

Hi!

I'm using this component in my project but the designer prototyped with a height, as the following:

image

But whenever I try to change the height of the dayContainerStyle, seems like there is a parent element that does not allow me to do that.

Here is a result:

WhatsApp Image 2023-07-16 at 11 12 23

This is how i'm using the component:

<View>
			<ReactNativeCalendarStrip
				locale={{
					name: "pt-br",
					config: {
						months:
							"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split(
								"_"
							),
						monthsShort:
							"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),
						weekdays:
							"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split(
								"_"
							),
						weekdaysShort: "dom_seg_ter_qua_qui_sex_sáb".split("_"),
						weekdaysMin: "Do_Se_Te_Qu_Qu_Se_Sa".split("_"),
					},
				}}
				scrollable
				style={{
					height: 120,
					paddingTop: 20,
					paddingBottom: 10,
				}}
				markedDates={props.markedDates}
				daySelectionAnimation={{
					type: "background",
					highlightColor: colors.primary,
					duration: 100,
				}}
				dayContainerStyle={{
					height: 70,
					width: 40,
					paddingLeft: 10,
				}}
				highlightDateNumberStyle={{ color: colors.white }}
				highlightDateNameStyle={{ color: colors.white }}
				calendarColor={colors.white}
				calendarHeaderStyle={{ color: "black" }}
				dateNumberStyle={{ color: "black" }}
				dateNameStyle={{ color: "black" }}
				iconContainer={{ flex: 0.1 }}
				onDateSelected={(data) => {
					let auxDate = moment(data).toDate();
					setDate(auxDate);
				}}
				selectedDate={date}
			/>
		</View>
		```


	
Is there a way I can reach this result with this component? thank you
@Fe-souza
Copy link

Fe-souza commented Aug 7, 2023

You try to use dayComponentHeight={80} but his limit is 80, I don't know if it will help.

I'm facing some issues with this too

@Abhaychovatiya
Copy link

Abhaychovatiya commented Nov 9, 2023

@GabrielDvt @Fe-souza i have faced same issue and got this solution, if you want to increase the size of day Component then you should pass same height to this both prop like this.

CalendarStripe Props
dayContainerStyle={{ height: 60 }}
dayComponentHeight={60}
.

Note : you can give maximum dayComponentHeight={80}

If you want to give more height to dayComponentHeight then you have make patch in nodemodule location ==> node_modules > react-native-calendar-strip > src >CalendarStrip.js in this screen you will find static defaultProps = {
maxDayComponentSize: 80 }. you can change this defaultValue.

Note: if you are make changes in node_modules then make sure to get this library code out of node_modules otherwise when you will delete node_modules and re-install it that time you will loose this changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants