The Plant Calendar

Set the plant's time zone, workdays and holidays, which planned dates count working days on, and what a change does to work orders already planned.

Most planning tools count “Day 3” as three calendar days, so a step lands on a Saturday or on Thanksgiving, and the plan is wrong before the floor sees it. In Threaded, the plant has one working calendar: its time zone, the days it works and its holidays. Planned dates count working days on it, so Day 3 from a Thursday is the next Monday.

#What it is

  • Plant calendar. One per organization: a time zone, the workdays, and a list of holidays. Admin › Plant calendar is where you set it.
  • Time zone. Where the plant is. Each working day runs from midnight to midnight in this zone, and “today” for the plant is today in this zone, not in your browser’s.
  • Workdays. The days of the week the plant works, Monday to Sunday. Planned dates skip the others.
  • Holidays. One-off days off, each with a date and a name. A holiday is a single date; it doesn’t repeat each year.
  • The default calendar. Until someone saves a calendar, dates use UTC, Monday to Friday, and no holidays. Pages that plan dates say so with a “Plant calendar not saved yet” banner.

#Rules

  • Owners and Editors can change the calendar. Operators and View All members can’t, and don’t see Admin, but everything that plans dates reads the calendar for everyone.
  • There’s no read-only view of the page: everyone who reaches Admin › Plant calendar can edit it.
  • The calendar counts whole days only. There are no shifts: a day ends at midnight in the plant’s time zone.
  • At least one workday is needed. The last selected workday can’t be turned off.
  • Up to 400 holidays, past ones included. Each needs a date and a name of 100 characters or fewer, two holidays can’t share a date, and a holiday can be at most ten years ahead. There’s no limit on how far back a holiday can be: past holidays stay, and count toward the 400, until you remove them.
  • Nothing is saved until you click Save. On a calendar never saved, the page fills in your browser’s time zone, but saving is still up to you.
  • Saving replaces the whole calendar, holidays and all.
  • Saving moves the planned dates of unfinished work orders to the new calendar. When a save would move any, Threaded asks first and says how many. Orders that have their original dates keep them, so you can compare. The planned dates update shortly after you save, once Threaded has re-dated the orders.
  • If someone else saved the calendar after you opened it, your save is refused, so their changes aren’t lost. Reload to see theirs, then make your changes again. Reload asks first when you have changes, since it discards them.
  • The plant calendar’s time zone is separate from the time zone of scheduled report refreshes. Changing one doesn’t change the other.
  • The page shows who saved the calendar last and on what date. There’s no history of earlier versions.
  • Your organization needs Run turned on. See Feature Access and Billing.

#In the app

#Set up the calendar

  1. Open Admin from the gear at the bottom of the rail, then Plant calendar. Or click Set up calendar on a “Plant calendar not saved yet” banner.
  2. On a calendar never saved, the banner reads “Check the settings below, then click Save.” Under Time zone, check the zone. On a calendar never saved, it’s your browser’s zone, with the note “From this browser. Change it if the plant is in another time zone.” Type a city or a zone name (“chicago”, “central”) to find another.
  3. Under Workdays, click the days the plant works. A selected day is filled in and checked.
  4. Under Holidays, click Add holiday for each day off, then pick its date and give it a name.
  5. Click Save. It reads Saving… until the save is done.

#Change workdays or holidays

Change what you need, then click Save. To remove a holiday, click its remove button. Holidays from today on are listed first, by date. Earlier ones are under Past holidays; click it to see and remove them.

At 400 holidays, Add holiday gives way to “Up to 400 holidays. Remove some past ones first.”

#Confirm a save that moves dates

When saving would move the planned dates of any unfinished work order, a dialog says how many, for example “Saving moves the planned dates on 18 unfinished work orders. The 11 with original dates keep them for comparison.” Click Save and move dates to save, or Cancel to keep editing. When nothing would move, the save goes straight through.

#See who changed it last

The toolbar shows “Last saved by Hank on Nov 13”, with the date in the plant’s time zone. It reads “Last saved on Nov 13” when the person who saved it has no name or has left the organization, and the date has its year when it isn’t this year.

#Troubleshooting

“Someone else saved the plant calendar. Reload to see their changes.” Another Owner or Editor saved after you opened the page. Click Reload. If you have changes, Threaded asks “Discard your changes and load theirs?”: click Discard and reload to load their calendar, or Keep editing to note your changes first. Then make your changes again and save.

“You can’t change the plant calendar right now. Your changes weren’t saved. Ask an owner or editor.” Your role changed while you were editing, or Run was turned off for the organization. Ask an Owner or Editor.

“Couldn’t save the plant calendar. Try again.” The save didn’t reach Threaded or failed there. Your changes are still on the page; click Save again.

“Couldn’t load the plant calendar. Check your connection and try again.” The calendar didn’t load, or a Reload failed. Click Try again.

A field is marked after Save. Threaded refused the save and moved you to the first field it marked, which may be a holiday under Past holidays. Fix it and save again.

“Pick a time zone from the list.” The zone isn’t one Threaded knows. Pick another from the list. A zone that’s brand new in your browser may not be known to Threaded yet.

“Ask an editor or owner to set up the plant calendar.” You see this on the banner as an Operator or View All member. Dates use the default until an Owner or Editor saves a calendar.

#From the CLI or API

There’s no threaded command for the calendar. Use threaded api call with these operations:

  • run_format_plant_calendar_retrieve (GET /api/v2/run-format/organizations/<organization-id>/planning/calendar/): the calendar. On a calendar never saved, it returns the default with isDefault: true. Anyone in the organization can read it.
  • run_format_plant_calendar_update (PUT on the same path): save the whole calendar. Send timezone, workdays (ISO weekdays, 1 = Monday to 7 = Sunday), holidays (date and name each) and updatedAt: the value from your last read, exactly as returned, or null if the calendar was never saved. It returns the saved calendar. Owners and Editors, and service tokens that can edit.
  • The same PUT with --query dry_run=1: check the save and count what it would move, without saving. It returns orders (unfinished work orders whose planned dates would move) and withBaseline (how many of those keep their original dates).
threaded api call --operation-id run_format_plant_calendar_retrieve --path organization_uuid=<organization-id>
threaded api call --operation-id run_format_plant_calendar_update --path organization_uuid=<organization-id> \
  --query dry_run=1 --body-file calendar.json

Common errors:

  • 400 with a message on timezone, workdays or a holiday row (keyed by its position in holidays): the messages are the ones the page shows, such as “At least one workday is needed.” or “Thanksgiving is already on Nov 26.” Fix that field and send again. More than 400 holidays is a message on holidays itself.
  • 400 on dry_run: send dry_run=1, or leave it out to save. Any other value is refused so a typo can’t save by accident.
  • 403: the caller can’t edit the organization, or Run isn’t turned on.
  • 409 with code plant_calendar_stale: the calendar was saved since your updatedAt. Read it again, apply your change to what you read, and send its updatedAt.