提问人:Angel 提问时间:11/15/2023 最后编辑:Angel 更新时间:11/15/2023 访问量:19
如何使用@fullcalendar资源TimelineYear视图跳转到当前日期?
How to jump to current date with @fullcalendar resourceTimelineYear view?
问:
我正在使用 @fullcalenda/angular 的 resourceTimelineYear 插件。我正在尝试将我的时间线 gotoDate 设置为当前日期。似乎跳到了正确的年份,但在 1 月 1 日,而不是实际日期。
任何帮助将不胜感激。
我的代码:
calendarOptions: CalendarOptions = {
plugins: [resourceTimelinePlugin, interactionPlugin, adaptivePlugin, momentTimezonePlugin, rrulePlugin],
timeZone: 'local',
initialView: 'resourceTimelineYear',
headerToolbar: {
start: 'title',
center: '',
end: ''
},
slotLabelFormat: [{ weekday: 'short' }, { day: 'numeric', }],
nowIndicator: true,
initialDate: new Date(),
}
ngAfterViewInit(): void {
this.calendar.getApi().gotoDate(new Date());
}
我的包裹:
- “@angular/cli”:“^15.2.10”
- “@fullcalendar/角度”:“^6.1.9”
- “@fullcalendar/bootstrap5”: “^6.1.9”
- “@fullcalendar/核心”:“^6.1.9”
- “@fullcalendar/资源时间线”:“^6.1.9”
- “@fullcalendar/rrule”:“^6.1.9”
我试图在ngAfterViewInit()上使用gotToDate强制它并将其设置为初始日期,但结果似乎相同。
答: 暂无答案
评论