Custom Day Cells

Add custom content to the day cells of the calendar. This can be dynamic content based on the date like an activity tracker that uses daily move data from an array of records.

Use the renderDayContent function to return custom markup that will be used when the day cells are being rendered.

Download and try example

Demo

Loading the live demo

Preview in full screen

Code

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

$(function () {
  var activities = [
    {
      date: '2026-10-16T00:00',
      move: 200,
      exercise: 360,
      stand: 180,
    },
    {
      date: '2026-10-17T00:00',
      move: 360,
      exercise: 150,
      stand: 230,
    },
    {
      date: '2026-10-18T00:00',
      move: 180,
      exercise: 200,
      stand: 280,
    },
    {
      date: '2026-10-19T00:00',
      move: 120,
      exercise: 150,
      stand: 200,
    },
    {
      date: '2026-10-20T00:00',
      move: 320,
      exercise: 180,
      stand: 100,
    },
    {
      date: '2026-10-21T00:00',
      move: 120,
      exercise: 100,
      stand: 200,
    },
    {
      date: '2026-10-22T00:00',
      move: 230,
      exercise: 170,
      stand: 330,
    },
    {
      date: '2026-10-23T00:00',
      move: 320,
      exercise: 260,
      stand: 80,
    },
    {
      date: '2026-10-24T00:00',
      move: 200,
      exercise: 140,
      stand: 180,
    },
    {
      date: '2026-10-25T00:00',
      move: 360,
      exercise: 300,
      stand: 160,
    },
    {
      date: '2026-10-26T00:00',
      move: 80,
      exercise: 360,
      stand: 360,
    },
    {
      date: '2026-10-27T00:00',
      move: 220,
      exercise: 170,
      stand: 290,
    },
    {
      date: '2026-10-28T00:00',
      move: 120,
      exercise: 40,
      stand: 100,
    },
    {
      date: '2026-10-29T00:00',
      move: 120,
      exercise: 200,
      stand: 80,
    },
  ];

  $('#demo-activity-calendar')
    .mobiscroll()
    .datepicker({
      controls: ['calendar'],
      touchUi: true,
      display: 'inline',
      renderDayContent: function (args) {
        var a = activities.find(function (obj) {
          return +new Date(obj.date) === +args.date;
        });

        function getDeg(nr) {
          return {
            rotate1: nr > 180 ? 180 : nr,
            rotate2: nr > 180 ? nr - 180 : 0,
          };
        }

        function getStyle(rotate) {
          return ' style="transform: rotateZ(' + rotate + 'deg)"';
        }

        return (
          '<div class="screen">' +
          '<div class="' +
          (a ? 'dial move' : '') +
          '">' +
          '<div class="dial-background"' +
          (a ? ' style="background:#752a2a"' : '') +
          '></div>' +
          '<div class="dial-container container1">' +
          '<div class="wedge"' +
          (a ? getStyle(getDeg(a.move).rotate1) : '') +
          '></div>' +
          '</div>' +
          '<div class="dial-container container2">' +
          '<div class="wedge"' +
          (a ? getStyle(getDeg(a.move).rotate2) : '') +
          '></div>' +
          '</div>' +
          '<div class="marker start"></div>' +
          '<div class="marker end"' +
          (a ? getStyle(a.move) : '') +
          '></div>' +
          '</div>' +
          '<div class="' +
          (a ? 'dial exercise' : '') +
          '">' +
          '<div class="dial-background"' +
          (a ? ' style="background:#4a6915"' : '') +
          '></div>' +
          '<div class="dial-container container1">' +
          '<div class="wedge"' +
          (a ? getStyle(getDeg(a.exercise).rotate1) : '') +
          '></div>' +
          '</div>' +
          '<div class="dial-container container2">' +
          '<div class="wedge"' +
          (a ? getStyle(getDeg(a.exercise).rotate2) : '') +
          '></div>' +
          '</div>' +
          '<div class="marker start"></div>' +
          '<div class="marker end"' +
          (a ? getStyle(a.exercise) : '') +
          '></div>' +
          '</div>' +
          '<div class="' +
          (a ? 'dial stand' : '') +
          '">' +
          '<div class="dial-background"' +
          (a ? ' style="background:#157b76"' : '') +
          '></div>' +
          '<div class="dial-container container1">' +
          '<div class="wedge"' +
          (a ? getStyle(getDeg(a.stand).rotate1) : '') +
          '></div>' +
          '</div>' +
          '<div class="dial-container container2">' +
          '<div class="wedge"' +
          (a ? getStyle(getDeg(a.stand).rotate2) : '') +
          '></div>' +
          '</div>' +
          '<div class="marker start"></div>' +
          '<div class="marker end"' +
          (a ? getStyle(a.stand) : '') +
          '></div>' +
          '</div>' +
          '</div>'
        );
      },
    });
});
  

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.