---
title: "Javascript Timeline Daily Event Listing Example | Mobiscroll"
component: "Timeline"
framework: "JavaScript"
library_version: "6.1.5"
url: "https://demo.mobiscroll.com/javascript/timeline/event-listing"
---

# Daily Event Listing - JavaScript Timeline demo

Show events as full-day labels on a Javascript Timeline — useful for spotting overloaded resources and managing schedules without an hourly time grid. Plain JS api for usage everywhere.

- [Live demo](https://demo.mobiscroll.com/javascript/timeline/event-listing)
- [View code on GitHub](https://github.com/acidb/mobiscroll-demos-javascript/tree/main/src/demos/eventcalendar/timeline/event-listing)
- This demo in other frameworks: [jQuery](https://demo.mobiscroll.com/jquery/timeline/event-listing.md), [Angular](https://demo.mobiscroll.com/angular/timeline/event-listing.md), [React](https://demo.mobiscroll.com/react/timeline/event-listing.md), [Vue](https://demo.mobiscroll.com/vue/timeline/event-listing.md)

## Description

In situations when users are interested in seeing a daily summary rather than an hour-by-hour layout of events use the `eventDisplay: 'fill'` property under the `timeline` configuration of the [`view`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-view) option.

This is especially useful for spotting overloaded resources/days and helps in managing and creating efficient schedules.

**Are you building UI for planning employee shifts?** [Check out this example →](https://demo.mobiscroll.com/javascript/timeline/employee-shifts)

## What this demo shows

- A desktop timeline layout where days are arranged horizontally and resources are listed as rows on the left.
- **Header navigation** The month and year label opens date navigation, the previous and next arrows move between months, and the Today button returns to the current date.
- **View switcher** The header includes Work week, Week, and Month options, with Month selected by default.
- **Work week view** Selecting Work week updates the timeline to show Monday through Friday.
- **Week view** Selecting Week updates the timeline to show a full Sunday-to-Saturday week.
- **Month view** Selecting Month updates the timeline to show the full month. The date strip below the header shows the visible days, with the current date highlighted.
- **Resources** Multiple resources are shown as separate timeline rows.
- **Event labels** Events appear as colored labels with bold titles.
- **Daily event listing** The timeline uses `eventDisplay: 'fill'` so events fill the day column instead of being shown in an hour-by-hour layout.
- **Date positioning** Events are placed by their assigned resource.
- **Event interaction** Events highlight on hover.
- **Event selection** Clicking an event selects and highlights it.
- **Event creation** New events can be created by double-clicking the timeline or by clicking and dragging across a time range.
- **Scrolling** The timeline supports horizontal and vertical scrolling for navigating through dates and resources.

## Best for

- **Daily resource summaries** Showing which resources have events on each day without using an hourly schedule layout.
- **Capacity checks** Spotting overloaded resources or busy days across a team, location, room, asset, or equipment list.
- **Shift and assignment planning** Reviewing daily work assignments where the exact time of day is less important than the resource and date.
- **Multi-resource scheduling** Comparing availability and workload across several resources in the same timeline.
- **Planning over longer ranges** Switching between work week, full week, and month views depending on the level of overview needed.
- **Operational dashboards** Giving planners a compact view of scheduled work while still allowing event selection, creation, and scrolling.

## API used in this demo

- [`theme`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-theme) - option
- [`themeVariant`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-themeVariant) - option
- [`clickToCreate`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-clickToCreate) - option
- [`dragToCreate`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-dragToCreate) - option
- [`dragToMove`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-dragToMove) - option
- [`dragToResize`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-dragToResize) - option
- [`eventDelete`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-eventDelete) - option
- [`view`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-view) - option
- [`data`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-data) - option
- [`resources`](https://mobiscroll.com/docs/javascript/eventcalendar/api#opt-resources) - option
- [`renderHeader`](https://mobiscroll.com/docs/javascript/eventcalendar/api#renderer-renderHeader) - renderer
- [`setOptions`](https://mobiscroll.com/docs/javascript/eventcalendar/api#method-setOptions) - method
- [`setEvents`](https://mobiscroll.com/docs/javascript/eventcalendar/api#method-setEvents) - method

## Code

### JS

```js
mobiscroll.setOptions({
  theme: 'ios',
  themeVariant: 'light'
});

var calendar = mobiscroll.eventcalendar('#demo-event-listing', {
  clickToCreate: true,
  dragToCreate: true,
  dragToMove: true,
  dragToResize: true,
  eventDelete: true,
  view: {
    timeline: {
      type: 'month',
      eventDisplay: 'fill',
    },
  },
  data: [
    {
      start: '2026-10-19T00:00',
      end: '2026-10-22T00:00',
      allDay: true,
      title: 'Event 1',
      resource: 1,
    },
    {
      start: '2026-10-21T09:00',
      end: '2026-10-25T15:00',
      title: 'Event 2',
      resource: 2,
    },
    {
      start: '2026-10-24T00:00',
      end: '2026-10-31T00:00',
      allDay: true,
      title: 'Event 3',
      resource: 2,
    },
    {
      start: '2026-10-11T07:00',
      end: '2026-10-16T12:00',
      title: 'Event 4',
      resource: 2,
    },
    {
      start: '2026-10-28T00:00',
      end: '2026-11-03T00:00',
      allDay: true,
      title: 'Event 5',
      resource: 3,
    },
    {
      start: '2026-10-21T08:00',
      end: '2026-10-23T20:00',
      title: 'Event 6',
      resource: 4,
    },
    {
      start: '2026-10-19T00:00',
      end: '2026-10-22T00:00',
      allDay: true,
      title: 'Event 7',
      resource: 4,
    },
    {
      start: '2026-10-13T00:00',
      end: '2026-10-18T00:00',
      allDay: true,
      title: 'Event 8',
      resource: 5,
    },
    {
      start: '2026-10-27T00:00',
      end: '2026-11-04T00:00',
      allDay: true,
      title: 'Event 9',
      resource: 6,
    },
  ],
  resources: [
    {
      id: 1,
      name: 'Resource A',
      color: '#e20000',
    },
    {
      id: 2,
      name: 'Resource B',
      color: '#60e81a',
    },
    {
      id: 3,
      name: 'Resource C',
      color: '#3ba7ff',
    },
    {
      id: 4,
      name: 'Resource D',
      color: '#e25dd2',
    },
    {
      id: 5,
      name: 'Resource E',
      color: '#f1e920',
    },
    {
      id: 6,
      name: 'Resource F',
      color: '#1ac38d',
    },
  ],
  renderHeader: function () {
    return (
      '<div mbsc-calendar-nav class="md-event-listing-nav"></div>' +
      '<div class="md-event-listing-picker">' +
      '<label>Work week<input mbsc-segmented type="radio" name="view" value="workweek" class="event-listing-view-change"></label>' +
      '<label>Week<input mbsc-segmented type="radio" name="view" value="week" class="event-listing-view-change"></label>' +
      '<label>Month<input mbsc-segmented type="radio" name="view" value="month" class="event-listing-view-change" checked></label>' +
      '</div>' +
      '<div mbsc-calendar-prev class="md-event-listing-prev"></div>' +
      '<div mbsc-calendar-today class="md-event-listing-today"></div>' +
      '<div mbsc-calendar-next class="md-event-listing-next"></div>'
    );
  },
});

document.querySelectorAll('.event-listing-view-change').forEach(function (elm) {
  elm.addEventListener('change', function (ev) {
    switch (ev.target.value) {
      case 'workweek':
        calendar.setOptions({
          view: {
            timeline: {
              type: 'week',
              eventDisplay: 'fill',
              startDay: 1,
              endDay: 5,
            },
          },
        });
        break;
      case 'week':
        calendar.setOptions({
          view: {
            timeline: {
              type: 'week',
              eventDisplay: 'fill',
            },
          },
        });
        break;
      case 'month':
        calendar.setOptions({
          view: {
            timeline: {
              type: 'month',
              eventDisplay: 'fill',
            },
          },
        });
        break;
    }
  });
});

mobiscroll.getJson(
  'https://trial.mobiscroll.com/timeline-events/',
  function (events) {
    calendar.setEvents(events);
  },
  'jsonp',
);
```

### HTML

```html
<div class="md-event-listing">
    <div id="demo-event-listing"></div>
</div>
```

### CSS

```css
.md-event-listing-cont {
    position: relative;
    padding-left: 50px;
}

.md-event-listing-avatar {
    position: absolute;
    max-height: 50px;
    max-width: 50px;
    top: 21px;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    left: 20px;
}

.md-event-listing-name {
    font-size: 16px;
}

.md-event-listing-title {
    font-size: 12px;
    margin-top: 5px;
}

.md-event-listing .mbsc-segmented {
    max-width: 350px;
    margin: 0 auto;
    padding: 1px;
}

.md-event-listing-picker {
    flex: 1 0 auto;
}

.md-event-listing-nav {
    width: 200px;
}

/* material header order */

.mbsc-material.md-event-listing-prev {
    order: 1;
}

.mbsc-material.md-event-listing-next {
    order: 2;
}

.mbsc-material.md-event-listing-nav {
    order: 3;
}

.mbsc-material .md-event-listing-picker {
    order: 4;
}

.mbsc-material .md-event-listing-today {
    order: 5;
}

/* windows header order */

.mbsc-windows.md-event-listing-nav {
    order: 1;
}

.mbsc-windows.md-event-listing-prev {
    order: 2;
}

.mbsc-windows.md-event-listing-next {
    order: 3;
}

.mbsc-windows .md-event-listing-picker {
    order: 4;
}

.mbsc-windows .md-event-listing-today {
    order: 5;
}
```

## Implementation notes

- Set `timeline: { type: 'month', eventDisplay: 'fill' }` as the default view. `eventDisplay: 'fill'` makes each event span the full width of its day column regardless of its time range, turning the timeline into a daily event listing instead of an hour-by-hour grid.
- Add a three-option view switcher in the custom header using `renderHeader` (Angular: `headerTemplate`, Vue: `#header` slot). The three views and their configs are:
  - **Work week**: `timeline: { type: 'week', eventDisplay: 'fill', startDay: 1, endDay: 5 }`
  - **Week**: `timeline: { type: 'week', eventDisplay: 'fill' }`
  - **Month** (default): `timeline: { type: 'month', eventDisplay: 'fill' }`
- Build the custom header from: `CalendarNav`, a centered `SegmentedGroup` containing three `Segmented` options (`workweek` / `week` / `month`), then `CalendarPrev`, `CalendarToday`, `CalendarNext`.
- When the segmented selection changes, update the active view config; for the imperative API, call `calendar.setOptions({ view: ... })` directly.
- Define 6 generic resources (Resource A-F) with `id`, `name`, and `color`.
- Populate events using `dyndatetime` offsets relative to today - scatter 13 timed events across resources 1-6 on days ranging from today-4 to today+2 so that multiple resources have concurrent events on the same day, making the fill layout's density-spotting advantage visible.

## Run it in your project

1. If not signed up yet, or don't own a license, you can [start a free trial](https://mobiscroll.com/starttrial).

2. Clone the repository:

   ```
   git clone https://github.com/acidb/mobiscroll-demos-javascript.git
   ```

3. If not installed yet, install the Mobiscroll CLI from NPM:

   ```
   npm install -g @mobiscroll/cli
   ```

4. Config Mobiscroll - open a terminal window in the root directory and run:

   ```
   mobiscroll config javascript
   ```

5. Install dependencies - open a terminal window in the root directory and run:

   ```
   npm install
   ```

6. Run the project:

   ```
   npm run dev
   ```

On a trial, add `--trial` to the config command: `mobiscroll config javascript --trial`.

Running a demo locally requires a Mobiscroll trial or a license; setup is per framework at https://mobiscroll.com/docs/javascript/getting-started/installation

## Related demos

- Previous: [Variable Event Height](https://demo.mobiscroll.com/javascript/timeline/variable-event-height.md) - Show Javascript Timeline events sized to content — resource rows grow to fit the tallest event, keeping text visible in room or resource schedules.
- Next: [Day/Week View Switcher](https://demo.mobiscroll.com/javascript/timeline/switching-day-week-work-week-timeline.md) - Build resource schedules with day, work-week, and full-week views on a Javascript Timeline — switch views from the header to control time-grid detail.
