> For the complete documentation index, see [llms.txt](https://teamleader-sdk.mcore-services.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://teamleader-sdk.mcore-services.dev/api-reference/general/closing-days.md).

# Closing Days

Manage closing days in Teamleader Focus.

```php
Teamleader::closingDays()
```

|                          |                                                                       |
| ------------------------ | --------------------------------------------------------------------- |
| Class                    | `McoreServices\TeamleaderSDK\Resources\General\ClosingDays`           |
| Create / update / delete | ✓ / — / ✓                                                             |
| Pagination               | `page_size` / `page_number`; the response includes `meta` with totals |

## Endpoints

* `closingDays.add`
* `closingDays.delete`
* `closingDays.list`

## Filters

Passed as the first argument to `list()`. Any other key throws.

| Filter        | Description                                                      |
| ------------- | ---------------------------------------------------------------- |
| `date_after`  | Start of the period for which to return closing days (inclusive) |
| `date_before` | End of the period for which to return closing days (inclusive)   |

## Methods

### `delete()`

```php
delete($id, ...$additionalParams): array
```

Delete a closing day

* `$id` — Closing day UUID

### `forMonth()`

```php
forMonth(string $yearMonth): array
```

Get closing days for a specific month

* `$yearMonth` — Format: YYYY-MM

### `list()`

```php
list(array $filters = [], array $options = []): array
```

List closing days with enhanced filtering and pagination

Pagination metadata is always requested. The API only returns `meta.matches` when `includes=pagination` is sent, it costs nothing extra, and without it there is no total count — the only end-of-list signal would be a page shorter than the requested page size.

* `$filters` — Filters to apply
* `$options` — Additional options (pagination)

### `forYear()`

```php
forYear($year): array
```

Get closing days for a specific year

### `forDateRange()`

```php
forDateRange(string $startDate, string $endDate): array
```

Get closing days within a date range

* `$startDate` — Start date (YYYY-MM-DD)
* `$endDate` — End date (YYYY-MM-DD)

### `upcoming()`

```php
upcoming(int $daysAhead = 30): array
```

Get upcoming closing days (from today forward)

* `$daysAhead` — Number of days to look ahead (default: 30)

### `isClosingDay()`

```php
isClosingDay(string $date): bool
```

Check if a specific date is a closing day

* `$date` — Date in YYYY-MM-DD format

### `getAvailableFilters()`

```php
getAvailableFilters(): array
```

Get available filter fields

### `bulkAdd()`

```php
bulkAdd(array $dates): array
```

Bulk add multiple closing days

* `$dates` — Array of dates in YYYY-MM-DD format

### `add()`

```php
add(string $day): array
```

Add a closing day (alias for create)

* `$day` — Date in YYYY-MM-DD format

### `create()`

```php
create(array $data): array
```

Add a closing day (create method override)

* `$data` — Data containing 'day' field

### `getCommonHolidays()`

```php
getCommonHolidays(int $year, string $country = 'BE'): array
```

Belgian public holidays for a year, as name => Y-m-d

The ten legal holidays (wettelijke feestdagen). Until v2.2.14 this returned three fixed dates plus Easter Monday — and Boxing Day, which is not a Belgian public holiday — and Easter Monday was left out on PHP builds without ext-calendar. The movable feasts are now computed here, so no extension is needed.

Only Belgium is supported; any other country code throws rather than returning Belgian dates under another name.

* `$country` — BE

**Throws** `InvalidArgumentException` For a country other than BE

## Examples

Get all closing days:

```php
$closingDays = Teamleader::closingDays()->list();
```

Get closing days within a date range:

```php
$closingDays = Teamleader::closingDays()->list(['date_after' => '2023-12-01', 'date_before' => '2023-12-31']);
```

Add a new closing day:

```php
$result = Teamleader::closingDays()->create(['day' => '2024-02-01']);
```

Delete a closing day:

```php
$result = Teamleader::closingDays()->delete('closing-day-uuid');
```

Get closing days for current month:

```php
$closingDays = Teamleader::closingDays()->forMonth(date('Y-m'));
```
