简体   繁体   English

想要在 fullcalendar 上展示活动

[英]Want to bring events to show on fullcalendar

I use fullcalendar-Angular ( angular 11, fullcalendar 5.5.0 ).我使用 fullcalendar-Angular ( angular 11, fullcalendar 5.5.0 )。

But I cannot retrieve events to show on the calendar.但我无法检索要在日历上显示的事件。

I retrieve events in the picture below:我在下图中检索事件:

https://i.stack.imgur.com/UdAGJ.png https://i.stack.imgur.com/UdAGJ.png

This is the fetch code.这是获取代码。

   
   this.Studio.getStudioCalendar().subscribe(data => {
        data["data"].map((list) => {
              this.eventDateSet.push(list);
           });
           this.calendarOptions;
           console.log("calendar data :",this.eventDateSet)
           console.log("calendarOptions  :",this.calendarOptions)
   })
 } 

This is the libar FullCalendar's code.这是 libar FullCalendar 的代码。

    dateClick: this.handleDateClick.bind(this),
    headerToolbar: {
      left: "prev,next today",
      center: "title",
      right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek,prevYear,nextYear",
    },
    initialView: "dayGridMonth",
    weekends: true,
    editable: true,
    selectable: true,
    selectMirror: true,
    dayMaxEvents: true,
    dayHeaderFormat: {
      weekday: "short",
      month: "numeric",
      day: "numeric",
      omitCommas: true,
    },
    buttonText: {
      today: "วันนี้",
      month: "เดือน",
      week: "สัปดาห์",
      day: "วัน",
      list: "กำหนดการ",
    },
    locale: "th",
   events: [this.eventDateSet],
  }; 

You might wanna try with the initialEvents property of your CalendarOptions .您可能想尝试使用CalendarOptionsinitialEvents属性。

Also, your events should be of type EventInput which doesn't contain a dateStart or dateEnd property but just start and end .此外,您的事件应该是EventInput类型,它不包含dateStartdateEnd属性,而只是startend

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM