如何仅在React Fullcalendar中显示工作时间

发布于 2025-02-02 02:09:41 字数 710 浏览 4 评论 0原文

我有此代码,它是用于为我的日历设置参数的代码:

import timeGridPlugin from '@fullcalendar/timegrid'
import FullCalendar from '@fullcalendar/react'

calevents.push({
        title: res.data[i].title, 
        start: moment(res.data[i].dateTime).toDate(), 
        end: moment(res.data[i].dateTime).add(2, 'hours'), 
        displayEventEnd: true, 
        id: res.data[i]._id, 
        allDayDefault: false,
        slotMinTime: '8:00:00',
        slotMaxTime: '18:00:00',
          extendedProps: {
            description: res.data[i].description
          },
      })

基本上,我要做的是为日历设置企业的。使用slotmintimeslotmaxtime我认为我可以设置它,但是,它不会更改日历的视图。

我该如何解决?

I have this code which is the code for setting paramaters for my calendar:

import timeGridPlugin from '@fullcalendar/timegrid'
import FullCalendar from '@fullcalendar/react'

calevents.push({
        title: res.data[i].title, 
        start: moment(res.data[i].dateTime).toDate(), 
        end: moment(res.data[i].dateTime).add(2, 'hours'), 
        displayEventEnd: true, 
        id: res.data[i]._id, 
        allDayDefault: false,
        slotMinTime: '8:00:00',
        slotMaxTime: '18:00:00',
          extendedProps: {
            description: res.data[i].description
          },
      })

Basically, what I am trying to do is set the business hours of my business for the calendar. Using slotMinTime and slotMaxTime I thought I could set it, however, it doesn't change the view of the calendar.

How can I fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文