【问题标题】:onSelectSlot Mobile React Big CalendaronSelectSlot 移动反应大日历
【发布时间】:2021-03-22 02:57:45
【问题描述】:

当我尝试在移动浏览器上使用 React Big Calendar 时,我无法使用 onSelectSlot 函数。我可以单击事件,但无法单击时间段以打开新的事件模式。控制台也没有错误。

这是我的代码。我使用了 longPressThreshold 但没有用。

<DragAndDropCalendar
            date={defaultDate}
            onNavigate={(date) => setDefaultDate(date)}
            onEventDrop={moveEvent}
            selectable={true}
            formats={formats}
            messages = {{week: 'Hafta', day: 'Gün', month: 'Ay', previous: 'Geri', next: 'İleri', today: 'Bugün', showMore: function(e) {return '+' + e + ' daha'}}}
            events={eventsList}
            onSelecting={slot => false}
            localizer={localizer}
            view={view}
            showMultiDayTimes={false}
            onView={(e) => setView(e)}
            views={['day', 'week', 'month']}
            step={calendarTimeCell}
            culture={'tr'}
            min={new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 7, 0)}
            max={new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 21, 0)}
            onSelectEvent={event => {
                let endDate = moment(event.endDate);
                let startDate = moment(event.startDate)
                openEditAppointmentModal(event, customerData, moment.duration(endDate.diff(startDate)).asMinutes())
            }}
            longPressThreshold={10}
            onSelectSlot={openNewAppointmentModal}
            tooltipAccessor={(event) => appointmentTooltip(event, resourceIdAccessor)}
            resources={view === 'week' ? null : resources}
            resourceAccessor={view === 'week' ? null : (event) => resourceIdAccessor === 'serviceId' ? event.serviceId : event.teammateId}
            resourceIdAccessor={view === 'week' ? null : resourceIdAccessor}
            resourceTitleAccessor={view === 'week' ? null : 'resource_name'}
            titleAccessor={(event) => appointmentTitleAccessor(event, view)}
            startAccessor={(event) => new Date(event.startDate)}
            endAccessor={(event) => new Date(event.endDate)}
            eventPropGetter={(event, start, end, isSelected) => eventStyleGetter(event, start, end, isSelected)}
        />

编辑:我可以在月视图中清楚地单击时间段。但是周和日视图不适用于 onSelectSlot。

【问题讨论】:

    标签: reactjs react-big-calendar


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2019-07-01
      • 1970-01-01
      • 2020-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-25
      • 1970-01-01
      相关资源
      最近更新 更多