Repeat events on selected days in fullcalendar

╄→尐↘猪︶ㄣ 提交于 2020-01-06 12:47:46

问题


How i can create repeating events on selected days, for example in monday and tuesday. My event enter code here array data from json:

"title": "Test",
"allDay": false,
"start": "2014-12-11 9:30:00",
"end": "2014-12-11 13:00:00",
"repeat": '1,2,3', // first 3 days of week

How i can do this? I want show only on calendar repeating, becouse repeating is save i database. I must create repeating events on selected days, i have problem with this.


回答1:


You should create your events as different events, with same Id.

From documentation

id String/Integer. Optional

Uniquely identifies the given event. Different instances of repeating events should all have the same id.

So your events should be like:

myevents = [
   {
      "id":1
      "title": "Test",
      "allDay": false,
      "start": "2014-12-12 9:30:00",
      "end": "2014-12-12 13:00:00"
   },
   {
      "id":1
      "title": "Test",
      "allDay": false,
      "start": "2014-12-13 9:30:00",
      "end": "2014-12-13 13:00:00"
   },
   {
      "id":1
      "title": "Test",
      "allDay": false,
      "start": "2014-12-14 9:30:00",
      "end": "2014-12-14 13:00:00"
   }
]


来源:https://stackoverflow.com/questions/27375870/repeat-events-on-selected-days-in-fullcalendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!