Appearance
Calendar
Monthly calendar view for an individual worker, showing public holidays, absences, and leave entries colour-coded by type.
Route
/organisations/:orgId/workers/:id/calendar
Layout
Calendar Header
Displays the worker's city and full country name (resolved from the ISO code via isoToCountryName).
Calendar Component
Rendered via the WorkerCalendar component. Shows a monthly grid with colour-coded cells for different event types (public holidays, annual leave, absences, etc.).
Data Loading
On initialisation:
- Fetches the EOR instance via
getEorInstance. - Fetches worker details via
getWorkerDetails. - Loads calendar data via
loadCalendarDatafor the worker's EOR ID, effective country ISO (preferringjobLocationRegionoverjobLocation), and start date. - Initial load covers three years: previous, current, and next.
Lazy Loading
When the user navigates to a year that has not yet been loaded, loadYearData is called for that year. Loaded years are tracked in a Set to avoid duplicate requests. A new Map reference is created after loading to trigger Svelte reactivity.
Behavior notes
- The calendar container has horizontal scrolling enabled and 2rem left padding.
- The
WorkerCalendarcomponent is rendered withshowHeaderset totrue, displaying the city and country above the calendar grid. - If worker data or EOR instance cannot be loaded, an alert warning is displayed: "Unable to load calendar data for this worker."
- The effective country ISO code is
jobLocationRegionwhen available, otherwisejobLocation. - The country display name is resolved via
isoToCountryName; if resolution fails, the raw ISO code is shown. If nojobLocationis available, "Unknown Country" is shown.