{"id":20140233,"url":"https://github.com/10quality/php-calendar","last_synced_at":"2025-10-05T17:10:02.596Z","repository":{"id":56937930,"uuid":"82863629","full_name":"10quality/php-calendar","owner":"10quality","description":"PHP calendar handler class.","archived":false,"fork":false,"pushed_at":"2019-05-27T00:51:28.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"v1.0","last_synced_at":"2025-09-18T18:29:31.317Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/10quality.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-22T23:40:20.000Z","updated_at":"2019-05-08T00:45:33.000Z","dependencies_parsed_at":"2022-08-21T06:50:18.299Z","dependency_job_id":null,"html_url":"https://github.com/10quality/php-calendar","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/10quality/php-calendar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10quality%2Fphp-calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10quality%2Fphp-calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10quality%2Fphp-calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10quality%2Fphp-calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/10quality","download_url":"https://codeload.github.com/10quality/php-calendar/tar.gz/refs/heads/v1.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10quality%2Fphp-calendar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278486308,"owners_count":25994945,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-13T21:49:50.052Z","updated_at":"2025-10-05T17:10:02.578Z","avatar_url":"https://github.com/10quality.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calendar (PHP class)\n\n[![Latest Stable Version](https://poser.pugx.org/10quality/php-calendar/v/stable)](https://packagist.org/packages/10quality/php-calendar)\n[![Total Downloads](https://poser.pugx.org/10quality/php-calendar/downloads)](https://packagist.org/packages/10quality/php-calendar)\n[![License](https://poser.pugx.org/10quality/php-calendar/license)](https://packagist.org/packages/10quality/php-calendar)\n\nCalendar handler library for PHP.\n\n**NOTE:** This class will not echo / print the calendar.\n\nFeatures:\n\n* Handles monthly weeks and days.\n* Ability to attach data.\n* Able to be render in any custom template.\n\n## Installation\n\nWith composer, make the dependecy required in your project:\n```bash\ncomposer require 10quality/php-calendar\n```\n\n## Usage\n\nThe following example will build the calendar for the current month:\n\n```php\nuse TenQuality\\Utility\\Calendar;\n\n$calendar = new Calendar();\n$calendar-\u003ebuild();\n```\n\n### Attaching data\n\n```php\n// Example\n$data = array();\n$data[] = $obj; // Either ARRAY or OBJECT\n\n$calendar = new Calendar();\n$calendar-\u003edata = $data;\n// Array column or object filed containing the date related to each data row\n$calendar-\u003edataDateFiled = 'dateCreated';\n// Build\n$calendar-\u003ebuild();\n```\n\n### Printing\n\nPrinting example:\n```html\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003c?php foreach ($calendar-\u003eheaders as $header) : ?\u003e\n                \u003cth\u003e\u003c?php echo $header ?\u003e\u003c/th\u003e\n            \u003c?php endforeach ?\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003c?php foreach ($calendar-\u003eweeks as $week) : ?\u003e\n            \u003ctr\u003e\n                \u003c?php foreach ($week-\u003edays as $day) : ?\u003e\n                    \u003ctd\u003e\n                        \u003ch2\u003e\u003c?php echo $day-\u003enumber ?\u003e\u003c/h2\u003e\n                        \u003c?php foreach ($day-\u003edata as $row) : ?\u003e\n                            \u003c!--TODO: What ever needs to be done with data--\u003e\n                        \u003c?php endforeach ?\u003e\n                    \u003c/td\u003e\n                \u003c?php endforeach ?\u003e\n            \u003c/tr\u003e\n        \u003c?php endforeach ?\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n```\n\n### Other properties or methods\n\nBuild calendar for a specific date:\n```php\n$calendar = new Calendar('2017-01-25');\n$calendar-\u003ebuild();\n```\n\nGet previous and next month dates:\n```php\n$calendar = new Calendar('2017-01-25');\n$calendar-\u003enextMonthDate;\n$calendar-\u003eprevMonthDate;\n```\n\n## Coding guidelines\n\nPSR-4.\n\n## LICENSE\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 [10Quality](http://www.10quality.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10quality%2Fphp-calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F10quality%2Fphp-calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10quality%2Fphp-calendar/lists"}