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 dayContentTemplate option for passing a custom template that will be used when the day cells are being rendered.

Get started with this example

Demo

Loading the live demo

Preview in full screen

Code

import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { MbscModule, setOptions  } from '@mobiscroll/angular';

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

@Component({
  selector: 'app-root', 
  templateUrl: './app.component.html',
  standalone: true,
  imports: [CommonModule, MbscModule],
})
export class AppComponent {
  activities = [
    {
      date: '2026-10-18T00:00',
      move: 200,
      exercise: 360,
      stand: 180,
    },
    {
      date: '2026-10-19T00:00',
      move: 360,
      exercise: 150,
      stand: 230,
    },
    {
      date: '2026-10-20T00:00',
      move: 180,
      exercise: 200,
      stand: 280,
    },
    {
      date: '2026-10-21T00:00',
      move: 120,
      exercise: 150,
      stand: 200,
    },
    {
      date: '2026-10-22T00:00',
      move: 320,
      exercise: 180,
      stand: 100,
    },
    {
      date: '2026-10-23T00:00',
      move: 120,
      exercise: 100,
      stand: 200,
    },
    {
      date: '2026-10-24T00:00',
      move: 230,
      exercise: 170,
      stand: 330,
    },
    {
      date: '2026-10-25T00:00',
      move: 320,
      exercise: 260,
      stand: 80,
    },
    {
      date: '2026-10-26T00:00',
      move: 200,
      exercise: 140,
      stand: 180,
    },
    {
      date: '2026-10-27T00:00',
      move: 360,
      exercise: 300,
      stand: 160,
    },
    {
      date: '2026-10-28T00:00',
      move: 80,
      exercise: 360,
      stand: 360,
    },
    {
      date: '2026-10-29T00:00',
      move: 220,
      exercise: 170,
      stand: 290,
    },
    {
      date: '2026-10-30T00:00',
      move: 120,
      exercise: 40,
      stand: 100,
    },
    {
      date: '2026-10-31T00:00',
      move: 120,
      exercise: 200,
      stand: 80,
    },
  ];

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

  getTransform(rotate: number) {
    return 'rotateZ(' + rotate + 'deg)';
  }

  getActivity(day: any) {
    return this.activities.find((obj) => +new Date(obj.date) === +day.date);
  }
}

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.