How to add events to an in app calendar using React-Native-Calendar?

700 views Asked by At

I have built an in app calendar using react-native calendar, and I want the user to be able to add or delete appointments to the calendar, but cannot figure this part out. The user will be allowed to schedule up to a week in advance. How should I go about this?

Here is my code that generates the calendar:

import { Calendar, CalendarList, Agenda } from 'react-native-calendars';

const ScheduleScreen = ({navigation}) => {

const numWeeks = 1
const weekAhead = new Date; weekAhead.setDate(weekAhead.getDate()+ numWeeks * 7)

const [ item, setItem ] = useState({});

return(
....

<Agenda
          onDayPress = {(day)=>console.log('Day changed')}
          minDate = {new Date()}
          maxDate = {weekAhead}
          pastScrollRange = {0}
          futureScrollRange = {0}
        
          items = {{
            'new Date()': [],
            weekAhead: [],
          }}
        
        />
....

)
}
0

There are 0 answers