Skip to content

Calendar

Fabian Steiner edited this page Nov 4, 2026 · 2 revisions

Calendar

from xurrent import Calendar · module xurrent.calendars · API resource /calendars · Xurrent API docs

Business hours (calendar hours per weekday) and holidays that define when service hours, support hours and SLA clocks run.

Back to the overview

Fields

The named arguments of the constructor. Every other field of the API response is set as an attribute as well.

Field Type Default Converted to
id int
name Optional[str] None
disabled Optional[bool] None

Class methods

get_by_id

Calendar.get_by_id(connection_object: XurrentApiHelper, id: int) -> T

API: GET /calendars/{id}

get_calendars

Calendar.get_calendars(connection_object: XurrentApiHelper, predefinedFilter: CalendarPredefinedFilter = None, queryfilter: dict = None) -> List[T]

API: GET /calendars · Enums: CalendarPredefinedFilter

create

Calendar.create(connection_object: XurrentApiHelper, data: dict) -> T

API: POST /calendars

Methods

ref_str

calendar.ref_str() -> str

update

calendar.update(data: dict) -> T

API: PATCH /calendars/{id}

enable

calendar.enable() -> T

disable

calendar.disable() -> T

get_duration

calendar.get_duration(start: str, end: str, time_zone: str = None) -> dict

Calculate the duration between two timestamps according to the calendar.

  • start: Start datetime string (ISO 8601)
  • end: End datetime string (ISO 8601)
  • time_zone: Optional time zone name
  • Returns: Duration data from the API

API: GET /calendars/{id}/duration

get_hours

calendar.get_hours() -> List[dict]

Retrieve the calendar hours (weekday, time_from, time_until) of the calendar.

API: GET /calendars/{id}/calendar_hours

get_holidays

calendar.get_holidays() -> List

Retrieve the holidays associated with this calendar.

API: GET /calendars/{id}/holidays · Uses: Holiday

Enums

CalendarPredefinedFilter

Used by: Calendar.get_calendars

Value Description
enabled
disabled

Cross references

Uses:

Used by:

Clone this wiki locally