{"id":15525233,"url":"https://github.com/donatj/simplecalendar","last_synced_at":"2025-05-16T06:05:06.220Z","repository":{"id":961297,"uuid":"749771","full_name":"donatj/SimpleCalendar","owner":"donatj","description":"A simple PHP calendar rendering class","archived":false,"fork":false,"pushed_at":"2024-11-24T12:22:15.000Z","size":162,"stargazers_count":80,"open_issues_count":2,"forks_count":46,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-08T16:02:07.788Z","etag":null,"topics":["calendar-view","event-calendar","php"],"latest_commit_sha":null,"homepage":"https://donatstudios.com/SimpleCalendar","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/donatj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://www.paypal.me/donatj/15","ko_fi":"donatj","github":"donatj"}},"created_at":"2010-06-30T19:38:08.000Z","updated_at":"2024-11-24T12:22:18.000Z","dependencies_parsed_at":"2023-01-13T10:48:46.832Z","dependency_job_id":"312b0f52-cce8-4adb-b19e-9245c3b41897","html_url":"https://github.com/donatj/SimpleCalendar","commit_stats":{"total_commits":144,"total_committers":12,"mean_commits":12.0,"dds":"0.42361111111111116","last_synced_commit":"ae62fb12454088a7831d707700f4e5c9052d0efa"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2FSimpleCalendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2FSimpleCalendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2FSimpleCalendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2FSimpleCalendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donatj","download_url":"https://codeload.github.com/donatj/SimpleCalendar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478187,"owners_count":22077676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendar-view","event-calendar","php"],"created_at":"2024-10-02T10:55:55.477Z","updated_at":"2025-05-16T06:05:06.201Z","avatar_url":"https://github.com/donatj.png","language":"PHP","readme":"# Simple Calendar\n\n[![Latest Stable Version](https://poser.pugx.org/donatj/simplecalendar/version)](https://packagist.org/packages/donatj/simplecalendar)\n[![License](https://poser.pugx.org/donatj/simplecalendar/license)](https://packagist.org/packages/donatj/simplecalendar)\n[![ci.yml](https://github.com/donatj/SimpleCalendar/actions/workflows/ci.yml/badge.svg?)](https://github.com/donatj/SimpleCalendar/actions/workflows/ci.yml)\n\n\nA very simple, easy to use PHP calendar rendering class.\n\n## Requirements\n\n- **php**: \u003e=7.2\n- **ext-calendar**: *\n\n## Installing\n\nInstall the latest version with:\n\n```bash\ncomposer require 'donatj/simplecalendar'\n```\n\n## Examples\n\n```php\n\u003c?php\n\nrequire '../vendor/autoload.php';\n\necho '\u003clink rel=\"stylesheet\" href=\"../src/css/SimpleCalendar.css\" /\u003e';\n\n$calendar = new donatj\\SimpleCalendar('June 2010');\n\necho $calendar-\u003erender();\n\n```\n\n```php\n\u003c?php\nrequire '../vendor/autoload.php';\n\necho '\u003clink rel=\"stylesheet\" href=\"../src/css/SimpleCalendar.css\" /\u003e';\n\n$calendar = new donatj\\SimpleCalendar;\n\n$calendar-\u003esetStartOfWeek('Sunday');\n$calendar-\u003eaddDailyHtml('Sample Event', 'today', 'tomorrow');\n\n$calendar-\u003esetWeekDayNames([ 'Sun', 'Mon', 'Tu', 'W', 'Th', 'F', 'Sa' ]);\n$calendar-\u003esetStartOfWeek('Monday');\n\necho $calendar-\u003erender();\n\n```\n\n## Documentation\n\n### Class: \\donatj\\SimpleCalendar\n\nSimple Calendar\n\n#### Method: SimpleCalendar-\u003e__construct\n\n```php\nfunction __construct([ $calendarDate = null [, $today = null]])\n```\n\n##### Parameters:\n\n- ***\\DateTimeInterface*** | ***int*** | ***string*** | ***null*** `$calendarDate`\n- ***\\DateTimeInterface*** | ***false*** | ***int*** | ***string*** | ***null*** `$today`\n\n---\n\n#### Method: SimpleCalendar-\u003esetDate\n\n```php\nfunction setDate([ $date = null]) : void\n```\n\nSets the date for the calendar.\n\n##### Parameters:\n\n- ***\\DateTimeInterface*** | ***int*** | ***string*** | ***null*** `$date` - DateTimeInterface or Date string parsed by strtotime for the\ncalendar date. If null set to current timestamp.\n\n**Throws**: `\\Exception`\n\n---\n\n#### Method: SimpleCalendar-\u003esetCalendarClasses\n\n```php\nfunction setCalendarClasses(array $classes) : void\n```\n\nSets the class names used in the calendar  \n  \n```php  \n[  \n   'calendar'     =\u003e 'SimpleCalendar',  \n   'leading_day'  =\u003e 'SCprefix',  \n   'trailing_day' =\u003e 'SCsuffix',  \n   'today'        =\u003e 'today',  \n   'event'        =\u003e 'event',  \n   'events'       =\u003e 'events',  \n]  \n```\n\n##### Parameters:\n\n- ***array\u003cstring,string\u003e*** `$classes` - Map of element to class names used by the calendar.\n\n---\n\n#### Method: SimpleCalendar-\u003esetToday\n\n```php\nfunction setToday([ $today = null]) : void\n```\n\nSets \"today\"'s date. Defaults to today.\n\n##### Parameters:\n\n- ***\\DateTimeInterface*** | ***false*** | ***int*** | ***string*** | ***null*** `$today` - `null` will default to today, `false` will disable the\nrendering of Today.\n\n**Throws**: `\\Exception`\n\n---\n\n#### Method: SimpleCalendar-\u003esetWeekDayNames\n\n```php\nfunction setWeekDayNames([ ?array $weekDayNames = null]) : void\n```\n\n##### Parameters:\n\n- ***string[]*** | ***null*** `$weekDayNames`\n\n---\n\n#### Method: SimpleCalendar-\u003eaddDailyHtml\n\n```php\nfunction addDailyHtml(string $html, $startDate [, $endDate = null]) : void\n```\n\nAdd a daily event to the calendar\n\n##### Parameters:\n\n- ***string*** `$html` - The raw HTML to place on the calendar for this event\n- ***\\DateTimeInterface*** | ***int*** | ***string*** `$startDate` - Date string for when the event starts\n- ***\\DateTimeInterface*** | ***int*** | ***string*** | ***null*** `$endDate` - Date string for when the event ends. Defaults to start date\n\n**Throws**: `\\Exception`\n\n---\n\n#### Method: SimpleCalendar-\u003eclearDailyHtml\n\n```php\nfunction clearDailyHtml() : void\n```\n\nClear all daily events for the calendar\n\n---\n\n#### Method: SimpleCalendar-\u003esetStartOfWeek\n\n```php\nfunction setStartOfWeek($offset) : void\n```\n\nSets the first day of the week\n\n##### Parameters:\n\n- ***int*** | ***string*** `$offset` - Day the week starts on. ex: \"Monday\" or 0-6 where 0 is Sunday\n\n---\n\n#### Method: SimpleCalendar-\u003eshow\n\n```php\nfunction show([ bool $echo = true]) : string\n```\n\nReturns/Outputs the Calendar\n\n##### DEPRECATED\n\nUse `render()` method instead.\n\n##### Parameters:\n\n- ***bool*** `$echo` - Whether to echo resulting calendar\n\n##### Returns:\n\n- ***string*** - HTML of the Calendar\n\n---\n\n#### Method: SimpleCalendar-\u003erender\n\n```php\nfunction render() : string\n```\n\nReturns the generated Calendar","funding_links":["https://www.paypal.me/donatj/15","https://ko-fi.com/donatj","https://github.com/sponsors/donatj"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonatj%2Fsimplecalendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonatj%2Fsimplecalendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonatj%2Fsimplecalendar/lists"}