События не отображаются в сетке - PullRequest
1 голос
/ 13 октября 2019

Я добавил fullcalendar в свой проект, но по какой-то причине он не отображает события в сетке дня

Я пытался изменить часовой пояс, комбинацию времени и дат все же.

// Html

      <full-calendar  #calendar
                    defaultView="dayGridMonth"
                    selectable="true"
                    (eventClick)="handleEventClick($event)"
                    [header]="{
    left: 'prev,next today',
    center: 'title',
    right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
  }"
                    (dateClick)="handleDateClick($event)"
                    [eventSources]="eventSources"
                    [plugins]="calendarPlugins"
                    [weekends]="calendarWeekends"
                   ></full-calendar>

// Компонент

      calendarVisible = true;


       calendarPlugins = [dayGridPlugin, timeGrigPlugin, interactionPlugin];
          calendarWeekends = true;


      eventSources: [

        // your event

 source
    {
      events: [ // put the array in the `events` property
        {
          title  : 'event1',
          start  : '2019-10-01'
        },
        {
          title  : 'event2',
          start  : '2019-10-05',
          end    : '2019-10-07'
        },
        {
          title  : 'test',
          start  : '2019-10-12T12:30:00',
        }
      ],
      color: 'black',     // an option!
      textColor: 'yellow' // an option!
    }

    // any other event sources...

  ]

Пример, которым я следую: https://fullcalendar.io/docs/events-array enter image description here

Также используется Angular 8 с FullCalendar 4.3.1 в Chrome

1 Ответ

0 голосов
/ 13 октября 2019

try:

  eventSources:any = [
{
  events: [ // put the array in the `events` property
    {
      title  : 'event1',
      start  : '2010-01-01'
    },
    {
      title  : 'event2',
      start  : '2010-01-05',
      end    : '2010-01-07'
    },
    {
      title  : 'test',
      start  : '2010-10-12T12:30:00',
    }
  ],
  color: 'black',     // an option!
  textColor: 'yellow' // an option!
}
]

см. stackBlitz

также в своем посте вы показываете скриншот 2019 года и ваши события в 2010 году.

на основании этой декларации вы также можете написать

[events]="eventSources[0].events"
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...