Hi I am trying to achieve the UI using react-native-calenders as shown below
using react native calendars I have achieved this
so far this is what I have achieved
<Calendar
style={{
marginTop: normalize(-20),
}}
minDate={Date()}
monthFormat={'MMMM yyyy'}
markingType={ 'custom'}
markedDates={{
'2023-08-28': {
customStyles: {
container: {
flex: 1,
backgroundColor: colors.borderColor,
borderRadius: 0,
},
text: {color: colors.primary},
},
},
'2023-08-29': {
customStyles: {
container: {
flex: 1,
backgroundColor: colors.borderColor,
borderRadius: 0,
},
text: {color: colors.primary},
},
},
'2023-08-30': {
endingDay: true,
customContainerStyle: {
backgroundColor: 'red',
},
customStyles: {
container: {
backgroundColor: colors.primary,
width: '70%',
borderBlockColor: 'green',
},
text: {color: 'white'},
},
},
'2023-08-27': {
startingDay: true,
customStyles: {
container: {
backgroundColor: colors.primary,
width: '70%',
borderRadius: 50,
},
text: {color: 'white'},
},
},
}}
hideExtraDays={true}
onDayPress={day => {}}
theme={theme}
/>
The above is the code used to populate UI achieved in second UI. Am not sure how to set lightBlue color to whole range.
EDIT 1
Reference library link react-native-calendars
You'll want to use the
dayComponentattribute to conditionally render your days like this:Heres the documentation about the dayComponent