I'm using react-native-calendars. This library provides ability to mark dates on the calendar once mark parameter is passed to calendar object. I tried passing an array of objects but didn't worked sending multiple dates as below didn't worked as well.
How to dynamically mark multiple dates on it?
var nextDay =['2018-06-01',
'2018-06-05',
'2018-06-08',
'2018-06-07',
'2018-06-18',
'2018-06-17',
'2018-05-28',
'2018-05-29'];
const mark = {
[nextDay]: {selected: true, marked: true}
};
this.state(
{
mark: mark,
})
<Calendar
onDayPress={this.onDayPress}
current={new Date()}
minDate={'2018-05-24'}
onMonthChange={(month) => {console.log('month changed', month)}}
hideArrows={false}
hideExtraDays={true}
disableMonthChange={false}
firstDay={1}
hideDayNames={false}
showWeekNumbers={false}
onPressArrowLeft={substractMonth => substractMonth()}
onPressArrowRight={addMonth => addMonth()}
markedDates={this.state.mark}
theme={{
backgroundColor: '#ffffff',
calendarBackground: '#ffffff',
textSectionTitleColor: '#b6c1cd',
selectedDayBackgroundColor: '#00adf5',
selectedDayTextColor: '#ffffff',
todayTextColor: '#00adf5',
dayTextColor: '#2d4150',
textDisabledColor: '#d9e1e8',
dotColor: '#00adf5',
selectedDotColor: '#ffffff',
arrowColor: 'orange',
monthTextColor: 'blue',
textMonthFontWeight: 'bold',
textDayFontSize: 16,
textMonthFontSize: 16,
textDayHeaderFontSize: 16
}}
/>