想要在全日历上显示事件

时间:2021-02-23 04:11:52

标签: javascript fullcalendar fullcalendar-5 angular11

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

但我无法检索要显示在日历上的事件。

我检索下图中的事件:

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

这是获取代码。

   
   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)
   })
 } 

这是 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],
  }; 

1 个答案:

答案 0 :(得分:1)

您可能想尝试使用 initialEventsCalendarOptions 属性。

此外,您的事件应该属于 EventInput 类型,它不包含 dateStartdateEnd 属性,而只包含 startend

相关问题