Assign a calendar to your library and calculate business days

You can assign a calendar to your library so that AODocs calculates dates in business days instead of calendar days – skipping weekends and your organization's public holidays. For example, a due date defined as "5 business days after submission" automatically lands on a working day.

Calendars are created at the tenant level by super administrators. Learn more: Manage calendars and public holidays on your AODocs tenant.

As a library administrator, you assign one calendar per library. All business-day calculations in the library – in calculated properties and custom scripts – use the assigned calendar.

Note: The calendar feature must be activated on your AODocs tenant (it's activated on demand by AODocs support, feature flag enableCalendar), and at least one calendar must exist. Otherwise, the Calendar setting isn't displayed in your library's general settings.

This article explains how to:

Automatically generated table of contents


Assign a calendar to your library

1. Open the library administration.

2. Select Library settings in the left panel. The General settings page opens.

3. In the Library customization section, under Calendar, search for and select the calendar to use for your library.

The General settings page with the Calendar setting in the Library customization section, described as Used for all business-day calculations in this library

4. If required, click See calendar to preview the selected calendar: its non-working days for each year, with their origin tags. The preview is read-only – only super administrators can edit calendars.

The read-only calendar preview panel opened with the See calendar button, showing the year selector and the list of non-working days with their tags

5. Click Save.

The Calendar setting with the Emirates business days calendar selected and the Save button at the top right

The calendar is now used for all business-day calculations in your library.

Note: Several libraries can share the same calendar. On a multinational tenant, assign each library the calendar that matches its country or business unit.


Remove the calendar from your library

To stop using a calendar, clear the selection in the Calendar setting of the general settings and save.

Important: Calculated properties and scripts that use business-day functions stop working when no calendar is assigned – the affected fields show an evaluation error. Update or remove these formulas first.


Calculate business days in your formulas

Once a calendar is assigned, use the addBusinessDays function in your calculated properties:

addBusinessDays(date, number)

For example, on a library with a Monday–Friday calendar, addBusinessDays('2024-01-10', 3) returns January 15, 2024: the calculation starts on Wednesday January 10 and skips the weekend.

In the formula builder, select Calendars > Add business days (default) in the right menu to insert the function into your formula.

The formula builder with addBusinessDays(date, number) in the formula and the Calendars section with the Add business days entry in the right menu

Learn more about the function's accepted arguments and behavior: Configure conditional logic to calculate property values.

In custom scripts, the same calculation is available through the calendar service:

LocalDate result = getCalendarService().addBusinessDays(date, amount);

How business days are calculated

Business-day calculations follow the assigned calendar's working week and non-working days:

  • The start date is never counted: adding 1 business day to a Friday returns the following Monday (on a Monday–Friday calendar).
  • Negative numbers go backwards: addBusinessDays(date, -5) returns the date 5 business days earlier.
  • Adding 0 business days returns the start date unchanged.
  • Non-working days defined in the calendar – public holidays, closures – are skipped, including across year boundaries.

Troubleshooting

The Calendar setting isn't displayed in my general settings. The calendar feature isn't activated on your tenant, or no calendar has been created yet. Contact your super administrator.

A calculated field shows the error "Library … has no calendar configured". The formula uses addBusinessDays but no calendar is assigned to the library. Assign a calendar in the general settings.

A date lands on a public holiday. The holiday probably isn't defined in the assigned calendar for that year. Ask your super administrator to import or add the missing non-working days.


Was this article helpful? 0 out of 0 found this helpful
If you didn’t find what you were looking for, don’t hesitate to leave a comment!
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.