Package Data | |
---|---|
Maintainer Username: | aharen |
Maintainer Contact: | hello@khusaam.com (Ahmed Khusaam) |
Package Create Date: | 2016-08-24 |
Package Last Update: | 2016-09-19 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-11 15:23:19 |
Package Statistics | |
---|---|
Total Downloads: | 51 |
Monthly Downloads: | 2 |
Daily Downloads: | 1 |
Total Stars: | 2 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Calendar generator with optional events for Laravel
composer require aharen/calendar
Add aharen\Clendar\CalendarServiceProvider::class
to the end of providers
in config/app.php
$calendar = new Calendar();
$calendar->month('2016-08')
->generate()
->withEvents(false);
The method withEvents()
when empty or set true will return events with 30 minute interval time array.
There are two methods for adding Events to the calendar.
addEvent($time, $event)
$time
- formatted as H:i
or accepts the string all_day
eg: $calendar->addEvent('04:30', 'Early morning walk');
$event
- accepts a string as your event detail
eg: `$calendar->days['05-08']->addEvent('08:00', 'that cool project goes live');`
addAllDay($event)
$event
- accepts a string as your event detail
eg: `$calendar->days['05-08']->addAllDay('Sleep all day');`