# Applying a calendar

## Overview

Add a calendar to your organization settings and Autoplan will use the calendar to calculate make part start/due dates. For instance, say you had a due date of 12/31/23 and your calendar only counted week days. If the leadtime was 90 days, the start date would be 8/25/23 instead of 10/2/23.&#x20;

When applying this, **make sure that the make part leadtimes are working days only!**

## How to add a calendar

For now, this setting is API only.

First, query your organization to get properties that we'll use in the following step:

```graphql
{
  organization(id: 1) {
    id
    _etag
    settings {
      plans {
        driveDemandFromKits
        workingTime
      }
    }
  }
}
```

Run this mutation:

```graphql
mutation UpdateOrganization($input: UpdateOrganizationInput!) {
  updateOrganization(input: $input) {
    organization {
      id
      domain
      name
      settings {
        plans {
          workingTime
        }
      }
    }
  }
}
```

with this input. Make sure to use the etag from the first query:

```graphql
{
  "input": {
    "id": 1,
    "etag": <etag from previous step>,
    "settings": {
      "plans": {
        "workingTime": "0 0 * * 1-5"
      }
    }
  }
}
```

The `workingTime` format is set to be in the style of a [cron job](https://crontab.guru/#*_*_*_*_1-5).&#x20;

* `0 0 * * 1-5` means that it will consider days Monday through Friday
* `0 0 * * 1-6` means that it will consider days Monday through Saturday
* `0 0 * * 0-3` means that it will consider days Sunday through Wednesday

For now, Autoplan will only respect the days portion of the cron-style string.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.firstresonance.io/plans-and-autoplan/applying-a-calendar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
