create event when click next month

﹥>﹥吖頭↗ 提交于 2019-12-13 03:04:37

问题


I'm using "fullcalendar" script - https://fullcalendar.io/ in order to display tours on calendar

how do i use ajax in order to pull tours data from db about the current/next/previous month.

I just need the code that get the choosen month date (by the user) and run the ajax

<div id="calendar"></div>

<script>

          $(document).ready(function() {
            var initialLocaleCode = 'en';

            $('#calendar').fullCalendar({
              header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay,listMonth'
              },

              eventLimit: true, 
              editable: false,

              events: [

                {
                    title: 'tour 1',
                    start: '2019-05-05',
                    end:  '2019-05-11',
                    className: 'bg-warning'
                },{
                    title: 'title for tour num 2',
                    start: '2019-05-19',
                    end:  '2019-05-25',
                    className: 'bg-purple'
                },{
                    title: '3td tour title',
                    start: '2019-05-16',
                    end:  '2019-05-21',
                    className: 'bg-info'
                }   
              ]
            });


          });

</script>

来源:https://stackoverflow.com/questions/56422777/create-event-when-click-next-month

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