PHPackages                             cultuurnet/calendar-summary-v3 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cultuurnet/calendar-summary-v3

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cultuurnet/calendar-summary-v3
==============================

Library to convert cultuurnet dates to a readable summary

v4.0.8(1y ago)054.1k↓17.5%1[1 PRs](https://github.com/cultuurnet/calendar-summary-v3/pulls)3Apache-2.0PHPPHP ^7.4 || ^8.0

Since Oct 8Pushed 1y ago19 watchersCompare

[ Source](https://github.com/cultuurnet/calendar-summary-v3)[ Packagist](https://packagist.org/packages/cultuurnet/calendar-summary-v3)[ RSS](/packages/cultuurnet-calendar-summary-v3/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (20)Used By (3)

calendar-summary-v3
===================

[](#calendar-summary-v3)

Installation
------------

[](#installation)

```
composer require cultuurnet/calendar-summary-v3
```

How it works
------------

[](#how-it-works)

This library helps with formatting calendar information as HTML or plain text for events or places from Uitdatabank. We do this by parsing an `Offer` instance from JSONLD.

### Types

[](#types)

The `Offer` object has a `calendarType` property which can have one of the four following options:

- single
- multiple
- periodic
- permanent

### Parameters

[](#parameters)

There are 3 (optional) parameters which can be used on the initialisation of the formatters. Those are

- langCode
- hidePastDates
- timeZone

#### langCode

[](#langcode)

(string) Default value: 'nl\_BE'. You can use this parameter to change the language of the output that the formatter will produce. Currently works in nl, fr, de and en. The format here is standard PHP locales. For example 'fr\_BE' or 'de\_BE'.

#### hidePastDates

[](#hidepastdates)

(boolean) Default value: false. This parameter (when true) will only be used on offers with a calendarType 'multiple'. When true, dates in the past won't be in the formatter's output.

#### timeZone

[](#timezone)

(string) Default value: 'Europe/Brussels' You can set a different timezone with this parameter. Supported timezones can be found in this [list](http://php.net/manual/en/timezones.php).

Formats
-------

[](#formats)

After initializing the formatter, you call the format method with the following 2 parameters:

- Instance of the `Offer` object provided by this library
- The desired output format ('xs', 'sm', 'md' or 'lg')

Using an unsupported format will throw an exception.

Example
-------

[](#example)

```
