bootstrap-calendar icon indicating copy to clipboard operation
bootstrap-calendar copied to clipboard

how to add an appointment directly from calendar (similar to google calendar)?

Open khatran79 opened this issue 9 years ago • 2 comments

khatran79 avatar Oct 05 '15 02:10 khatran79

You need to code yourself...

I have something similar, i use the "onclick" event ;)

I use the option "onAfterEventsLoad" lo bind the click event:

onAfterViewLoad: function(view) {
                ...
                if(view == "month") {
                    $("#calendar .cal-month-day").click(function(e) {
                        var date= $(this).find('span').attr('data-cal-date');
                        if(! $(this).find('.events-list').length ) {
                            //No events on these day, we trigger the NewEvent
                                                NewEvent(date);
                        }


                    });
                }

                $('#cal-day-box #cal-day-panel #cal-day-panel-hour .cal-day-hour .row-fluid.cal-day-hour-part').unbind('click');
                $('#cal-day-box #cal-day-panel #cal-day-panel-hour .cal-day-hour .row-fluid.cal-day-hour-part').click( function() {
                                 //When click on hour in the day view
                    var date= $(this).data('calendar-day');
                    var time = $(this).children('.span1').children('b').html();
                    NewEvent(date, time);
                });


            },

I have more code, than i deleted (beacause is not relative to that...).

My function NewEvents trigger a modal, with can add a event to date & time.

I hope that this can be useful

eleazan avatar Oct 17 '15 10:10 eleazan

Hi, in this sollution, when I click in day view template, date is undefined, I see only time... what's wrong?

tonspeed avatar Jan 23 '20 21:01 tonspeed