Skip to content

Calendar

Purpose

Use a calendar panel to inspect the working calendar assigned to one object selected elsewhere in the application.

When to use

Choose Calendar for day/week/month availability, assignments, statuses, and templates of one resource or equipment object. Use Gantt for a whole production schedule and Table for ordinary object lists.

Prerequisites and ownership

  • request.getSelectedObjectForEventId must resolve to a selected object GUID.
  • The panel calls the Calendar API for the visible date range.
  • The adapter owns selection gating, API date normalization, explicit-offset request serialization, settings precedence, and sticky view/date state.
  • Installed @mes/aps-calendar@0.5.0 owns WorkingCalendar rendering and most calendar.* configuration.

Capability map

AreaSupported behavior
SelectionMounts only when the configured event supplies an object GUID
ViewsPackage day, week, and month surfaces
DataLoads calendar assignments for the package-requested visible interval
RemountRecreates the widget when the selected object changes
Sticky stateRemembers viewed date and calendar view across object changes during the browser session
Date boundaryNormalizes response ranges to UTC Z; request dates keep explicit offsets
SettingsMaps server calendar.* settings and supplies a resolved display timezone

Behavioral model

The wrapper resolves the selected object, mounts WorkingCalendar, and gives it the object GUID. The package requests a visible interval; the panel store calls the Calendar API and resolves the package configuration. View and viewed date are captured from the exposed widget and reapplied after object-driven remounts.

Alternatives, defaults, and precedence

  • A valid calendar.settings.timezone wins.
  • Without it, the browser IANA timezone is supplied.
  • UTC is used only when browser timezone resolution is unavailable or invalid.
  • The panel seeds locale ru-RU, working hours 00:0024:00, and an hour/minute time format, then applies mapped server settings.
  • Saved session view/date override package defaults on later mounts.
  • Other calendar.* values remain opaque package configuration.

Limitations

  • No selection produces an empty panel; there is no standalone object ID field.
  • Declared panelActions are not rendered by the current Calendar wrapper.
  • The timezone setting affects package formatting and some zoned day boundaries, but installed package code still contains browser-local date arithmetic.
  • Sticky view/date state is global for Calendar panels in the browser session, not persisted per application or object.

Minimal configuration

json
{
  "id": "equipment-calendar",
  "type": "calendar",
  "request": {
    "getSelectedObjectForEventId": "equipment--selected"
  }
}

Scenario: inspect the selected equipment calendar

json
{
  "version": "1.0.0",
  "panel": {
    "id": "equipment-calendar-workspace",
    "type": "group",
    "groupLayout": { "type": "columns", "resizable": true },
    "panels": [
      {
        "id": "equipment",
        "type": "table",
        "request": { "metaTypeName": "Equipment" },
        "columns": [
          { "attribute": "name", "label": "Equipment" }
        ],
        "pagination": { "rowsPerPage": [10] },
        "selectionMode": "single",
        "events": [
          {
            "id": "equipment--selected",
            "name": "onObjectSelect",
            "actions": [
              { "name": "addSelectedObjectToRequest" }
            ]
          }
        ]
      },
      {
        "id": "equipment-calendar",
        "type": "calendar",
        "request": {
          "getSelectedObjectForEventId": "equipment--selected"
        }
      }
    ]
  }
}

Expected result: selecting equipment mounts its calendar. Changing the view or date and selecting another row preserves that view/date for the new object.

Runnable demos

Open the shared configurator journeys

Open the Calendar tab and select an order. The wrapper mounts the installed @mes/aps-calendar widget with that order GUID. Changing the visible range causes the real widget callback and panel store to call POST /Calendar/GetCalendarAssignments; the local API returns package-shaped statuses and templates relative to the requested interval.

For settings-only comparison:

Open the shared browser-timezone settings profile Open the shared explicit-UTC settings profile

Those Gantt fixtures expose the two shared settings profiles. The Calendar journey above is the runnable evidence for selection and data acquisition.

Exact parameter reference

Next, copy the producing selection event and Calendar panel. Verify any additional calendar.* package setting against the installed package before depending on it.