bootstrap-calendar
bootstrap-calendar copied to clipboard
how to add an appointment directly from calendar (similar to google calendar)?
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
Hi, in this sollution, when I click in day view template, date is undefined, I see only time... what's wrong?