Customizable Day Headers

You can use renderAgendaDay to set up a custom day header template. This provides flexibility to format and style the date according to your preferences, allowing further customization of the headers and ensuring a consistent layout that matches your page's overall design.

In this demo, setting the showEmptyDays property to true allows us to add functionalities to the day header, such as creating new events for empty days, which is useful in various situations.

Download and try example

Demo

Loading the live demo

Preview in full screen

Build customizable agenda day headers — add per-day action buttons, including headers for days without events or any custom actions.

Code

mobiscroll.setOptions({
  locale:  ,
  theme: ' ',
  themeVariant: ' '
});

$(function () {
  var agenda = $('#demo-custom-day-header')
    .mobiscroll()
    .eventcalendar({
      cssClass: 'mds-custom-day-header',
      view: {
        agenda: {
          type: 'month',
          showEmptyDays: true,
        },
      },
      renderAgendaDay: function (day) {
        return (
          '<div class="mbsc-flex mbsc-flex-1-1 mbsc-align-items-center">' +
          '<div class="mbsc-flex-1-1">' +
          mobiscroll.formatDate('D MMM YYYY', day.date) +
          '</div>' +
          '<button class="mds-custom-day-header-btn" mbsc-button data-start-icon="plus" data-color="primary" data-variant="outline" data-date="' +
          mobiscroll.formatDate('YYYY-MM-DD', day.date) +
          '">Add event</button>' +
          '</div>'
        );
      },
    })
    .mobiscroll('getInst');

  $('#demo-custom-day-header').on('click', '.mds-custom-day-header-btn', function () {
    var newEvent = {
      title: 'Event',
      start: new Date($(this).data('date')),
      allDay: true,
    };

    agenda.addEvent(newEvent);

    mobiscroll.toast({
      message: 'Event added',
    });
  });

  $.getJSON('https://trial.mobiscroll.com/events/?vers=5&callback=?', function (events) {
    agenda.setEvents(events);
  });
});
  

Duplicate Session

You have signed in on a different machine. To keep everything in sync, you have been signed out of this session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.

Duplicate Session

We noticed you are logged in on a different machine and have closed your old session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.