Custom Date Header

Customize the date headers of the scheduler by adding relevant content, labels or completely change how they look. Use the renderSchedulerDay option for rendering a custom date header.

Get started with this example

Demo

Loading the live demo

Preview in full screen

Customize the date headers of the Scheduler — add custom layouts, labels, and milestone badges to day columns.

Code

import { Eventcalendar, formatDate, getJson, setOptions  } from '@mobiscroll/react';
import { useCallback, useEffect, useMemo, useState } from 'react';

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

const milestones = [
  {
    date: '2026-10-28T00:00',
    name: 'Project review',
    color: '#f5da7b',
  },
  {
    date: '2026-10-29T00:00',
    name: 'Product shipping',
    color: '#acf3a3',
  },
  {
    date: '2026-10-31T00:00',
    name: 'Cycle finish',
    color: '#ff84a0',
  },
];

function App() {
  const [myEvents, setEvents] = useState([]);

  const calView = useMemo(
    () => ({
      scheduler: {
        type: 'week',
        allDay: false,
        startDay: 1,
        endDay: 5,
        startTime: '08:00',
        endTime: '17:00',
      },
    }),
    [],
  );

  const myResources = useMemo(
    () => [
      {
        id: 1,
        name: 'Ryan',
        color: '#f7c4b4',
        img: 'https://img.mobiscroll.com/demos/m1.png',
      },
      {
        id: 2,
        name: 'Kate',
        color: '#c6f1c9',
        img: 'https://img.mobiscroll.com/demos/f1.png',
      },
      {
        id: 3,
        name: 'John',
        color: '#e8d0ef',
        img: 'https://img.mobiscroll.com/demos/m2.png',
      },
    ],
    [],
  );

  const renderCustomDay = useCallback((args) => {
    const date = args.date;
    const task = milestones.find((obj) => +new Date(obj.date) === +date) || {};

    return (
      <div className="header-template-container">
        <div className="header-template-date">
          <div className="header-template-day-name">{formatDate('DDDD', date)}</div>
          <div className="header-template-day">{formatDate('MMMM DD', date)}</div>
        </div>
        <div className="header-template-task" style={{ background: task.color }}>
          {task.name}
        </div>
      </div>
    );
  }, []);

  const renderCustomResource = useCallback(
    (resource) => (
      <div className="header-resource-template-content">
        <img className="header-resource-avatar" src={resource.img} />
        <div className="header-resource-name">{resource.name}</div>
      </div>
    ),
    [],
  );

  useEffect(() => {
    getJson(
      'https://trial.mobiscroll.com/resource-events/',
      (events) => {
        setEvents(events);
      },
      'jsonp',
    );
  }, []);

  return (
    <Eventcalendar
      clickToCreate={ }
      dragToCreate={ }
      dragToMove={ }
      dragToResize={ }
      eventDelete={ }
      view={calView}
      data={myEvents}
      resources={myResources}
      groupBy="date"
      renderSchedulerDay={renderCustomDay}
      renderResource={renderCustomResource}
    />
  );
}

export default App;

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.