Custom Date Header

Customize the date headers of the scheduler by adding relevant content, labels or completely change how they look. Use the schedulerDayTemplate template for setting up a custom date header template.

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

<script setup>
import {
  formatDate,
  getJson,
  MbscEventcalendar,
  setOptions 
} from '@mobiscroll/vue'
import { onMounted, ref } from 'vue'

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

const myEvents = ref([])

const myResources = ref([
  {
    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 myView = {
  scheduler: {
    type: 'week',
    allDay: false,
    startDay: 1,
    endDay: 5,
    startTime: '08:00',
    endTime: '17:00'
  }
}

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

function getTask(date) {
  return milestones.find((obj) => +new Date(obj.date) === +date) || {}
}

onMounted(() => {
  getJson(
    'https://trial.mobiscroll.com/resource-events/',
    (events) => {
      myEvents.value = events
    },
    'jsonp'
  )
})
</script>

<template>
  <MbscEventcalendar :clickToCreate="" :dragToCreate="" :dragToMove="" :dragToResize="" :eventDelete=""
    className="md-date-header-template"
    groupBy="date"
    :view="myView"
    :data="myEvents"
    :resources="myResources"
  >
    <template #schedulerDay="day">
      <div class="header-template-container">
        <div class="header-template-date">
          <div class="header-template-day-name">{{ formatDate('DDDD', day.date) }}</div>
          <div class="header-template-day">{{ formatDate('MMMM DD', day.date) }}</div>
        </div>
        <div class="header-template-task" :style="{ background: getTask(day.date).color }">
          {{ getTask(day.date).name }}
        </div>
      </div>
    </template>
    <template #resource="resource">
      <div class="header-resource-template-content">
        <img class="header-resource-avatar" :src="resource.img" />
        <div class="header-resource-name">{{ resource.name }}</div>
      </div>
    </template>
  </MbscEventcalendar>
</template>

<style>
.md-date-header-template .mbsc-schedule-header-day-cont {
  display: block;
}

.header-template-container {
  padding: 10px;
}

.header-template-date {
  text-align: left;
  line-height: 20px;
}

.header-template-day-name {
  font-weight: bold;
}

.header-template-day {
  font-size: 12px;
}

.header-template-task {
  position: absolute;
  top: 14px;
  right: 10px;
  font-size: 12px;
  line-height: 22px;
  padding: 0 10px;
  border-radius: 12px;
  color: #555;
}

.header-resource-template-content {
  position: relative;
}

.header-resource-avatar {
  max-height: 40px;
  max-width: 40px;
}

.header-resource-name {
  font-size: 14px;
}
</style>

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.