如何在FullCalendar中禁用事件拖动以调整持续时间
P粉787934476
P粉787934476 2023-09-15 12:40:23
0
1
394

您好,我正在使用 Angular 的完整日历,我想这样做,以便当用户单击日历中的空时间表(这是每周日历,每个日期间隔为 15 分钟)时,他们可以'按住单击并定义事件的持续时间。不幸的是,chatpgt 在这种情况下无法帮助我,因为它只显示截至 2020 年的信息,并且该库迄今为止仍在不断更新。

这是我的 html 代码:

<div class='demo-app'>
                    <div class='demo-app-main'>
                      <full-calendar *ngIf='calendarVisible' [options]='calendarOptions' >
                      <ng-template #eventContent let-arg>
                          <b>{{ arg.timeText }}</b>
                          <i>{{ arg.event.title }}</i>
                      </ng-template>
                      </full-calendar>
                    </div>
                </div>
</div>

这是我的 .ts calendarOptions 定义:

calendarOptions: CalendarOptions = {
    plugins: [
      interactionPlugin,
      dayGridPlugin,
      timeGridPlugin,
      listPlugin,
    ],
    headerToolbar: {
      left: 'prev,next today',
      center: 'title',
      right: 'timeGridWeek'
    },
    initialView: 'timeGridWeek',
    slotMinTime: '08:00:00',     
    slotMaxTime: '21:00:00',     
    slotDuration: '00:15:00',    
    slotLabelInterval: '00:15:00', 
    slotLabelFormat: {           
      hour: '2-digit',
      minute: '2-digit',
      hour12: true,
    },
    contentHeight: 'auto',      
    aspectRatio: 1.5,
    firstDay: 1,
    weekends: true,
    editable: false,
    selectable: false,
    selectMirror: true,
    dayMaxEvents: true,
    allDaySlot: false,
    dayHeaderFormat: {           
      weekday: 'short',
      day: '2-digit',
      month: '2-digit'
    },
    locales: [esLocale],
    businessHours: {           
      daysOfWeek: [0, 1, 2, 3, 4, 5, 6], 
      startTime: '09:00',        
      endTime: '21:00',          
    },
    select: this.handleDateSelect.bind(this),
    eventClick: this.handleEventClick.bind(this),
    eventsSet: this.handleEvents.bind(this),
    datesSet: this.handleDatesSet.bind(this)
  };

P粉787934476
P粉787934476

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!