# Views

The timeline of the Kendo UI for Angular Gantt enables you to display its tasks in different views.

## Types

The Gantt supports the following views:

* `day`—The timeline is divided into separate days and hours.
* `week`—The timeline is divided into weeks and days.
* `month`—The timeline is divided into months and weeks.
* `year`—The timeline is divided into years and months.

## Views Configuration

To select from the available view types and set their configuration options, place the respective view component within the `<kendo-gantt>` tag.

> * The order of views in the toolbar is determined by the order of the child view components.
> * You have to provide at least one view. Otherwise the Gantt will throw an error.

```html
<kendo-gantt>
    <kendo-gantt-timeline-day-view>
    </kendo-gantt-timeline-day-view>

    <kendo-gantt-timeline-week-view>
    </kendo-gantt-timeline-week-view>

    <kendo-gantt-timeline-month-view>
    </kendo-gantt-timeline-month-view>

    <kendo-gantt-timeline-year-view>
    </kendo-gantt-timeline-year-view>
</kendo-gantt>
```

The following example demonstrates the **Day**, **Week**, **Month** and **Year** Gantt views.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/gantt/views/config/source.txt)

## Active View

To control the currently selected view, use the [`activeView`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent#activeview) property.

> By default, the Gantt renders the `week` view as active. If the `week` view is not included in the current Gantt instance, the first view that is provided will be set as active.

The following example demonstrates how to control the currently active view of the Gantt using the `activeView` property.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/gantt/views/active-view/source.txt)

## Content Customization

The Gantt enables you [to customize its slot width](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/views#customizing-the-slot-width), [to set the start and end of the work day](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/views#setting-the-start-and-end-of-the-work-day) and [of the work week](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/views#setting-the-start-and-end-of-the-work-week).

### Customizing the Slot Width

To customize the slot width of the timeline views, set the `slotWidth` property of the targeted view to the desired width value in pixels.

The following example demonstrates how to customize the slot width of the Gantt timeline views using the `slotWidth` property.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/gantt/views/slot-width/source.txt)

### Formatting the Timeline Headers Date

To customize the date format of the timeline group headers and/or column headers, set the `timelineHeadersDateFormat` property of a desired view to the [`TimelineHeaderDateFormat`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/timelineheaderdateformat) object.

```html
<kendo-gantt-timeline-day-view
    [timelineHeadersDateFormat]="{ groupHeaderDateFormat: 'd/MM', columnHeaderDateFormat: 'HH:mm' }">
</kendo-gantt-timeline-day-view>
```

The following example demonstrates how to customize the timeline headers date format in all Gantt views.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/gantt/views/timeline-headers-date-formatting/source.txt)

### Setting the Start and End of the Work Day

The Gantt provides the following settings for customizing the start and end of the work day:

* [`workDayStart`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent#workdaystart) (`string` in `HH:mm` format)—The start time of the work day.
* [`workDayEnd`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent#workdayend) (`string` in `HH:mm` format)—The end time of the work day.

The following example demonstrates how to configure the start and end times of the work day in the Gantt using the `workDayStart` and `workDayEnd` properties.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/gantt/views/work-day/source.txt)

### Setting the Start and End of the Work Week

The Gantt provides the following settings for customizing the start and end of the work week:

* [`workWeekStart`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent#workweekstart) ([`Day`](https://www.telerik.com/kendo-angular-ui-develop/components/date-math/api/day))—The start time of the work week.
* [`workWeekEnd`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent#workweekend) ([`Day`](https://www.telerik.com/kendo-angular-ui-develop/components/date-math/api/day))—The end time of the work week.

The following example demonstrates how to configure the start and end days of the work week in the Gantt using the `workWeekStart` and `workWeekEnd` properties.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/gantt/views/work-week/source.txt)

### Current Time Marker

By default, the current time marker is enabled if the current date and time are visible in the view-range.

The Gantt can receive a [`currentTimeMarker`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent#currenttimemarker) input. These settings are applied to all of its views. However, if `currentTimeMarker` settings are passed to a given view individually (for example, [`week`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/timelineweekviewcomponent#currenttimemarker)), that takes precedence.

The following example demonstrates how to configure the current time marker in the Gantt using the `currentTimeMarker` input.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/gantt/timemarker/source.txt)

## Suggested Links

* [API Reference of the GanttComponent](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent)
* [API Reference of the Gantt ViewSelectorComponent](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/viewselectorcomponent)
* [API Index of the Gantt](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api)
