An open API service indexing awesome lists of open source software.

https://github.com/solution10/calendar

Straightforward calendars, with events, for any templating system.
https://github.com/solution10/calendar

calendar composer-packages php

Last synced: about 1 year ago
JSON representation

Straightforward calendars, with events, for any templating system.

Awesome Lists containing this project

README

          

# Solution10\Calendar

The Calendar component is a simple, but powerful package to help you in the rendering of, well, Calendars!

[![Build Status](https://travis-ci.org/Solution10/calendar.svg?branch=master)](https://travis-ci.org/Solution10/calendar)
[![Latest Stable Version](https://poser.pugx.org/solution10/calendar/v/stable.svg)](https://packagist.org/packages/solution10/calendar)
[![Total Downloads](https://poser.pugx.org/solution10/calendar/downloads.svg)](https://packagist.org/packages/solution10/calendar)
[![License](https://poser.pugx.org/solution10/calendar/license.svg)](https://packagist.org/packages/solution10/calendar)

## Features

- No dependancies
- PHP 5.3+
- Straightforward interface
- Support for multiple "resolutions" (week view, month view etc)
- Easily extended
- Templating system agnostic

## Getting Started

Installation is via composer, in the usual manner:

```json
{
"require": {
"solution10/calendar": "^1.0"
}
}
```

Creating a basic calendar is as such:

```php
setResolution(new MonthResolution());

// That's it! Let's grab the view data and render:
$viewData = $calendar->viewData();
$months = $viewData['contents'];
?>

title('F Y'); ?>


weeks()[0]->days() as $day): ?>
date()->format('D'); ?>




weeks() as $week): ?>

days() as $day): ?>

isOverflow()) {
if ($calendar->resolution()->showOverflowDays()) {
echo ''.$day->date()->format('d').'';
} else {
echo ' ';
}
} else {
echo $day->date()->format('d');
}
?>




```

Solution10\Calendar does not provide you with templates as we have no idea what templating
engine (if any) you're using. Instead, we give you a powerful and simple API so you can
do the rendering yourself.

## Further Reading

### Userguide

For more information on creating Calendars, see the [Calendars Section](http://github.com/solution10/calendar/wiki/Calendars).

If you want to know more about Resolutions, check out the [Resolutions Section](http://github.com/solution10/calendar/wiki/Resolutions).

Want to see how you can add Events to your calendars? You'll be wanting the [Events Section](http://github.com/solution10/calendar/wiki/Events).

## PHP Requirements

- PHP >= 5.3

## Author

Alex Gisby: [GitHub](http://github.com/alexgisby), [Twitter](http://twitter.com/alexgisby)

## License

[MIT](http://github.com/solution10/calendar/tree/master/LICENSE.md)

## Contributing

[Contributors Notes](http://github.com/solution10/calendar/tree/master/CONTRIBUTING.md)