Full-calender add color based on external event

后端 未结 2 1465
野趣味
野趣味 2021-01-25 09:54

I am using jquery full-calender. In page I have two input element

1- startdate( its date to start some event)

2- frequency( no of day for that event after that

2条回答
  •  伪装坚强ぢ
    2021-01-25 10:23

    IT'S NEARLY IMPOSSIBLE TO CORRECTLY ANSWER QUESTIONS WITHOUT CODE.

    But... here's a best guess. The calendar responds to a button click in this example. You'd take your dates and colors and create your events object something like below:

    $('button').on('click', function() {
        e.preventDefault()
    
        $('#calendar').fullCalendar({
            events: [{
                title: '1',
                start: new Date(2014, 02, 25, 10, 30),
                end: new Date(2014, 02, 27, 10, 30),
                allDay: false,
                editable: false,
                backgroundColor: '#ED1317'
            }, {
                title: '2',
                start: new Date(2014, 02, 26, 10, 30),
                end: new Date(2014, 02, 28, 10, 30),
                allDay: false,
                editable: false,
                backgroundColor: '#BADA55'
            }]
        });
    })
    

提交回复
热议问题