![QUIQQER Calendar Controls](bin/images/Readme.png)

# QUIQQER Calendar Controls

Reusable calendar, date picker, scheduler and time filter controls for QUIQQER.

```text
quiqqer/calendar-controls
```


## Features

- JavaScript calendar and date picker controls
- Calendar scheduler based on DHTMLX Scheduler
- Time and period filter controls
- Localized labels and date picker locales


## Installation

```shell
composer require quiqqer/calendar-controls
./console setup
```


## Support and contribution

- Issue tracker: https://dev.quiqqer.com/quiqqer/calendar-controls/-/issues
- Source code: https://dev.quiqqer.com/quiqqer/calendar-controls
- Support: support@quiqqer.com


## Usage

### Get the scheduler

A scheduler is a calendar object which manages a calendar.  
Scheduler: https://dhtmlx.com/docs/products/dhtmlxScheduler/  

```javascript

require(['package/quiqqer/calendar-controls/bin/Scheduler'], function(Scheduler) {
    console.log(Scheduler.getScheduler());
});

```

### Load scheduler extensions

```javascript

require([
    'package/quiqqer/calendar-controls/bin/Scheduler'
], function(Scheduler) {
    Scheduler.loadExtension('agenda_view').then(function(Scheduler) {
        console.log(Scheduler.getScheduler());
    });
});

```

```javascript

// Load multiple extensions

require([
    'package/quiqqer/calendar-controls/bin/Scheduler'
], function(Scheduler) {
    Promise.all([
        Scheduler.loadExtension('agenda_view'),
        Scheduler.loadExtension('collision'),
        Scheduler.loadExtension('cookie')
    ]).then(function(Scheduler) {
        console.log(Scheduler.getScheduler());
    });
});

```

### Time filter / time selection

```javascript

require(['package/quiqqer/calendar-controls/bin/controls/TimeFilter'], function(TimeFilter) {

    // buttons
    var Filter = new TimeFilter({
        name  : 'timeFilter',
        events: {
            onChange: function() {

            }
        }
    });

});


```

## Development

```shell
composer dev:init
composer test
```

The package contains browser-side code only. PHPStan validates the package's PHP-based quality and test bootstrap, while PHPUnit verifies metadata, XML declarations and required visual assets.

## License

GPL-2.0-or-later
