1

我已经使用 react-native 日历构建了一个应用程序日历,我希望用户能够向日历添加或删除约会,但无法弄清楚这部分。用户将被允许提前一周安排。我该怎么办?

这是我生成日历的代码:

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: [],
          }}
        
        />
....

)
}
4

0 回答 0