applying a calendar.md

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.

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:

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

Run this mutation:

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:

{
  "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.

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