React本地日历(wix)-资源视图

2vuwiymt  于 2023-02-13  发布在  React
关注(0)|答案(1)|浏览(143)

我一直在这个问题上挣扎在这一周,我一直试图找出如何实现资源视图的React Native,我尝试了wix日历之一,但我不能得到这个视图到目前为止。有人可以帮助我或有任何其他库,我可以给它一个尝试?也尝试了React Native日历事件库。
这是我的代码:

<View style={styles.screen}>
    <CalendarProvider
     style={{ marginBottom: 40 }}
     date={currentDate}
     onDateChanged={() => console.log('onDateChanged')}
     onMonthChange={() => console.log('onMonthChanged')}
     showTodayButton={true}
     disabledOpacity={0.6}
    >
    <ExpandableCalendar
        showWeekNumbers={false}
        showScrollIndicator={false}
        showsHorizontalScrollIndicator={false}
        showsVerticalScrollIndicator={false}
        showSixWeeks={false}
        firstDay={1}
        markedDates={marked}
    />
    <TimelineList
        key={1}
        events={eventsByDate}
        timelineProps={timelineProps}
        showNowIndicator
        scrollToFirst
        initialTime={INITIAL_TIME}
    />
    </CalendarProvider>
</View>

这就是我要找的
Resource View

sqyvllje

sqyvllje1#

eventsByDate的JSON应该如下所示,键应该是事件发生日期的数组。

export const eventsByDate = {
  ["2023-02-11"]: [
    {
      start: "2023-02-11T10:48:00.000Z",
      end: "2023-02-11T12:48:00.000Z",
      title: "Merge Request to React Native Calendars",
      summary: "Merge Timeline Calendar to React Native Calendars",
    },
    {
      start: "2023-02-11T11:00:00.000Z",
      end: "2023-02-11T12:48:00.000Z",
      title: "test item",
      summary: "bladiebla",
    },
    {
      start: "2023-02-11T15:23:28.771Z",
      end: "2023-02-11T19:23:28.771Z",
      title: "Meeting A",
      summary: "Summary for meeting A",
      color: "lightgrey",
    },
  ],
}

祝你好运!

相关问题