简体   繁体   English

Fullcalendar Angular:添加基于星期几的事件。

[英]Fullcalendar Angular: Add an Event based on Day of the Week.

Being quite new to fullcalendar. 对Fullcalendar来说是个新手。 I have my event that creates a new event for me based on Start Date and End Date. 我有一个根据开始日期和结束日期为我创建新事件的事件。

I want to create an event based on day of the week. 我想根据星期几创建一个活动。 So eg event 1 shud be on Monday and event 2 should be on Tuesday. 例如,事件1发生在星期一,事件2发生在星期二。

Is it possible to be done in FullCalendar Angular. 是否可以在FullCalendar Angular中完成。

So for example how do i add this event to Monday 因此,例如,我如何将此事件添加到星期一

{
        title: 'Birthday Party',
        start: new Date(y, m, d + 1, 19, 0),
        end: new Date(y, m, d + 1, 22, 30),
        allDay: false}

Any help appreciated. 任何帮助表示赞赏。

Use moment.js for convenience (comes with fullcalendar) 为了方便起见,使用moment.js (与fullcalendar一起提供)

Example: Event on next monday 示例:下周一活动

{
    title: 'Birthday Party',
    start: moment().day(1).hours(19).minutes(0).format(),
    end: moment().day(1).hours(22).minutes(30).format(),
    allDay: false
}

Note: Usually, moment.js comes in handy for several other date related tasks, too: converting timezones, getting timestamps, localized formatting, etc. 注意:通常,moment.js还可用于其他一些与日期相关的任务:转换时区,获取时间戳,本地化格式等。

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

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