{"id":37266026,"url":"https://github.com/breadthe/php-simple-calendar","last_synced_at":"2026-01-16T00:31:55.682Z","repository":{"id":62496824,"uuid":"250405217","full_name":"breadthe/php-simple-calendar","owner":"breadthe","description":"Generates a monthly array of dates for displaying in a calendar grid","archived":false,"fork":false,"pushed_at":"2022-04-24T03:34:53.000Z","size":11,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T11:47:49.556Z","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/breadthe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-27T00:38:51.000Z","updated_at":"2024-11-16T04:46:16.000Z","dependencies_parsed_at":"2022-11-02T11:32:22.779Z","dependency_job_id":null,"html_url":"https://github.com/breadthe/php-simple-calendar","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/breadthe/php-simple-calendar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breadthe%2Fphp-simple-calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breadthe%2Fphp-simple-calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breadthe%2Fphp-simple-calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breadthe%2Fphp-simple-calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/breadthe","download_url":"https://codeload.github.com/breadthe/php-simple-calendar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breadthe%2Fphp-simple-calendar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-16T00:31:55.121Z","updated_at":"2026-01-16T00:31:55.674Z","avatar_url":"https://github.com/breadthe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗓 PHP Simple Calendar\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/breadthe/php-simple-calendar.svg?style=flat-square)](https://packagist.org/packages/breadthe/php-simple-calendar)\n[![Build Status](https://img.shields.io/travis/breadthe/php-simple-calendar/master.svg?style=flat-square)](https://travis-ci.org/breadthe/php-simple-calendar)\n[![Quality Score](https://img.shields.io/scrutinizer/g/breadthe/php-simple-calendar.svg?style=flat-square)](https://scrutinizer-ci.com/g/breadthe/php-simple-calendar)\n[![Total Downloads](https://img.shields.io/packagist/dt/breadthe/php-simple-calendar.svg?style=flat-square)](https://packagist.org/packages/breadthe/php-simple-calendar)\n\nThis PHP 7.3+ package generates a 7 x 6 (42) or 7 x 5 (35) element array of the days of the month for the desired date. Each date is an instance of `Carbon\\Carbon`.\n\nIt automatically pads the beginning/end of the month with dates from the previous/next month. It can optionally pad with `null` instead.\n\nWhile it does not include an UI, you may use the generated matrix to build a month-grid calendar in the front-end technology of your choice. \n\n**NOTE** For now, at least, weeks start with Monday.\n\n## Requirements\n\n- PHP 7.3+\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require breadthe/php-simple-calendar\n```\n\n## Usage\n\n### Calendar grid generation\n\n```php\nuse Breadthe\\SimpleCalendar\\Calendar;\n\n$date = '2020-03-24'; // ISO date\n\n$calendar = new Calendar($date);\n$currentMonth = $calendar-\u003egrid();\n\n// or use the static constructor\n$currentMonth = Calendar::make($date)-\u003egrid();\n```\n\n### Start of previous/next months\n\nThe start (first day) of the previous and next months is a convenience that might come in handy when building the \"previous month\"/\"next month\" navigation in a calendar UI. These properties will exist even if `padWithNull()` is called.  \n\n```php\n$date = '2020-03-17';\n$currentMonth = Calendar::make($date);\n\n$currentMonth-\u003estartOfPrevMonth; // get the start of the previous month - instance of Carbon\n$currentMonth-\u003estartOfPrevMonth-\u003etoDateString(); // '2020-02-01'\n\n$currentMonth-\u003estartOfNextMonth; // get the start of the previous month - instance of Carbon\n$currentMonth-\u003estartOfNextMonth-\u003etoDateString(); // '2020-04-01'\n```\n\n### UI Example\n\nHere's an example of a simple calendar UI that can be built with this package.\n\n![Simple calendar UI](https://user-images.githubusercontent.com/17433578/77709612-ae1c6f80-6f99-11ea-84cb-a7eeba1d0244.png)\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email omigoshdev@protonmail.com instead of using the issue tracker.\n\n## Credits\n\n- [breadthe](https://github.com/breadthe)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## Laravel/PHP Package Boilerplate\n\nThis package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreadthe%2Fphp-simple-calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbreadthe%2Fphp-simple-calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreadthe%2Fphp-simple-calendar/lists"}