Download the PHP package nedal-network/php-calendar without Composer
On this page you can find all versions of the php package nedal-network/php-calendar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nedal-network/php-calendar
More information about nedal-network/php-calendar
Files in nedal-network/php-calendar
Package php-calendar
Short Description A simple PHP class to generate calendars.
License MIT
Homepage https://github.com/nedal-network/php-calendar
Informations about the package php-calendar
PHP Calendar
A PHP class that makes generating calendars as easy as possible.
You can use the addEvent() or addEvents() methods to mark events on the generated calendar.
This is fully compatible with PHP 5 through to PHP 8.1+
Installation via Composer
You can now install this class via composer.
$ composer require nedal-network/php-calendar
Remember to add the composer autoloader before using the class and use the correct namespace.
require 'vendor/autoload.php';
use NedalNetwork\phpCalendar\Calendar as Calendar;
Usage
Please make sure you have added the required classes.
Styling
You can apply styles in one of three ways:
1) Using $calendar->stylesheet() after you have initialised a calendar;
2) Using the calendar.css (or calendar.min.css) from the css directory;
3) Create your own stylesheet and add it to the head of your HTML document.
Draw a 'Month View' calendar
In its simplest form, use the following to create a calendar for current month. This will use all defaults (English, Week starting on Sunday, including stylesheet, printing to the page).
Or, you can break it down with full customisability:
Draw a 'Week View' calendar
Instead of a 'month view' calendar, you can now render as a 'week view'. To do this, simply use ->useWeekView(). Remember, when adding events to a week-view calendar, you need to include the time too (see events above).
You can change the start/end times of the day, along with the time interval by using the ->setTimeFormat method:
Monday Start Date
You can now change the weekly start date from a Sunday to a Monday. To activate this, simple use the useMondayStartingDate() method before you 'draw'.
Translated Calendars
We now ship with both English and Spanish translations, with more coming soon. Alternatively, you can add your own custom string translations for both the days and months using the following:
``
If you want to help with translations, use the code in the useSpanish() method as a guide, and open a pull-request.