> For the complete documentation index, see [llms.txt](https://docs.gridmate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gridmate.io/product-tour/calendars-and-timelines/compact-calendar.md).

# Compact Calendar

Display tasks, events or any object's records as activities on a compact calendar.

GridMate provides a lightning component **GM - Compact calendar** to display the **Event**, **Task**, or any **Objects** on the calendar as activities.

In this tutorial, we will configure the **GM - Compact calendar** component to display the **Task** and **Event** objects on the Calendar.

{% stepper %}
{% step %}

### Open the page

Select an **Opportunity** and edit the page in the Lightning App Builder.
{% endstep %}

{% step %}

### Add the component

From components list, drag and drop the component **GM - Compact calendar**. The **GM - Compact calendar** component is now ready for configuration in the Lightning App Builder.
{% endstep %}

{% step %}

### Configure the properties

The property values can be configured to tailor the component to the needs of the end-user. To perform a quick configuration, populate the properties in the table below.
{% endstep %}
{% endstepper %}

## Properties

| Property    | Demo value                                                           | Notes |
| ----------- | -------------------------------------------------------------------- | ----- |
| Title       | **Opportunity Calendar**                                             |       |
| Custom Icon | **standard:task**                                                    |       |
| Json config | See [Json config](#below-is-the-json-config-configured-for-the-demo) |       |

#### Below is the JSON Config configured for the demo

{% code fullWidth="false" %}

```coffeescript
[
    {
        "objectApiName": "Task",
        "dateField": "ActivityDate",       
        "iconName": "standard:task",
        "backgroundColor": "",
        "filter": "{\"WhatId\": {\"operator\" : \"=\", \"value\" : \"$recordId\"}}",
        "titleField": "Subject",
        "detailFields": [
            "Description"
        ]
    },
    {
        "objectApiName": "Event",
        "dateField": "ActivityDate",
        "fromDateField": "StartDateTime",
        "toDateField": "EndDateTime",
        "iconName": "standard:event",
        "backgroundColor": "#94baf7",
        "filter": "{\"WhatId\": {\"operator\" : \"=\", \"value\" : \"$recordId\"}}",
        "titleField": "Subject",
        "detailFields": [
            "Description"
        ]
    }
]
```

{% endcode %}

#### Coloring from a record field

`backgroundColor` accepts either a fixed colour or a JSON string of coloring rules (same `color` / `exp` format as the Single Calendar). A rule's `color` may be `$record.<FieldApiName>` to paint each activity with the colour stored on the record.

```json
{
    "objectApiName": "Event",
    "dateField": "ActivityDate",
    "fromDateField": "StartDateTime",
    "toDateField": "EndDateTime",
    "iconName": "standard:event",
    "backgroundColor": "[{\"color\":\"$record.Color__c\",\"exp\":true}]",
    "filter": "{\"WhatId\": {\"operator\" : \"=\", \"value\" : \"$recordId\"}}",
    "titleField": "Subject",
    "detailFields": ["Description"]
}
```

Below is a step by step tutorial to configure the **GM - Compact Calendar** 👇.

{% embed url="<https://youtu.be/1s0mevr9MtE>" %}
GridMate - Compact Calendar
{% endembed %}

## Next steps

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>GM - Compact Calendar</strong></td><td>Every property of the component.</td><td><a href="https://docs.gridmate.io/package-reference/components-library/calendars-and-timelines/gm-compact-calendar.md">GM - Compact Calendar</a></td></tr><tr><td><strong>Compact Calendar config</strong></td><td>Sample Json Config that shows a record's Tasks and Events in the GM - Compact Calendar.</td><td><a href="https://docs.gridmate.io/package-reference/config-samples/compact-calendar.md">Compact Calendar</a></td></tr><tr><td><strong>Single Calendar</strong></td><td>View and manage one object's records on a calendar with coloring, filters and flows.</td><td><a href="https://docs.gridmate.io/product-tour/calendars-and-timelines/single-calendar.md">Single Calendar</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gridmate.io/product-tour/calendars-and-timelines/compact-calendar.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
