allegedwizard / simple-calendar-php
Generates 7x6 sequence calendar arrays for a given month/year input.
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/allegedwizard/simple-calendar-php
This package is auto-updated.
Last update: 2025-09-29 02:51:21 UTC
README
composer require allegedwizard/simple-calendar-php
Generates a calendar data model array for a given input Month and Year.
Can be used to build calendar views.
<?php // Example output of: $calendar = new SimpleCalendar( 'August', 2023 ); $model = $calendar->toArray(); print_r( $model );
Array
(
[0] => Array
(
[date] => 2023-07-30
[day_of_month] => 30
[is_prev_month] => 1
[is_current_month] =>
[is_next_month] =>
[is_today] =>
)
[1] => Array
(
[date] => 2023-07-31
[day_of_month] => 31
[is_prev_month] => 1
[is_current_month] =>
[is_next_month] =>
[is_today] =>
)
[2] => Array
(
[date] => 2023-08-01
[day_of_month] => 1
[is_prev_month] =>
[is_current_month] => 1
[is_next_month] =>
[is_today] =>
)
...
- Arbitrary first day of week calendar assignment (defaults to Sunday).
- Allows for overriding the date($format, $timestamp) formatter function, for example wp_date() in WordPress environments to leverage localized time.
See tests/simple-calendar-test.php
for a full calendar example.