{"id":13405362,"url":"https://github.com/spatie/calendar-links","last_synced_at":"2025-05-14T13:09:21.869Z","repository":{"id":37821346,"uuid":"103638080","full_name":"spatie/calendar-links","owner":"spatie","description":"Generate add to calendar links for Google, iCal and other calendar systems","archived":false,"fork":false,"pushed_at":"2025-04-21T07:57:36.000Z","size":366,"stargazers_count":941,"open_issues_count":2,"forks_count":153,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-21T08:41:43.622Z","etag":null,"topics":["calendar","datetime","php"],"latest_commit_sha":null,"homepage":"https://spatie.be/opensource","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/spatie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"custom":"https://spatie.be/open-source/support-us"}},"created_at":"2017-09-15T09:14:02.000Z","updated_at":"2025-04-21T07:57:39.000Z","dependencies_parsed_at":"2022-07-12T16:54:31.540Z","dependency_job_id":"99304472-51c7-40ec-9c1e-6459fa4b2070","html_url":"https://github.com/spatie/calendar-links","commit_stats":{"total_commits":274,"total_committers":36,"mean_commits":7.611111111111111,"dds":"0.45620437956204385","last_synced_commit":"a74d683fc0de6e4d66885b6dc04d7f556b5d7b71"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fcalendar-links","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fcalendar-links/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fcalendar-links/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fcalendar-links/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spatie","download_url":"https://codeload.github.com/spatie/calendar-links/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149975,"owners_count":22022852,"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","datetime","php"],"created_at":"2024-07-30T19:01:59.779Z","updated_at":"2025-05-14T13:09:16.855Z","avatar_url":"https://github.com/spatie.png","language":"PHP","funding_links":["https://spatie.be/open-source/support-us"],"categories":["PHP"],"sub_categories":[],"readme":"# Generate add to calendar links for Google, iCal and other calendar systems\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/calendar-links.svg?style=flat-square)](https://packagist.org/packages/spatie/calendar-links)\n[![Total Downloads](https://img.shields.io/packagist/dt/spatie/calendar-links.svg?style=flat-square)](https://packagist.org/packages/spatie/calendar-links)\n[![Test](https://github.com/spatie/calendar-links/workflows/Test/badge.svg)](https://github.com/spatie/calendar-links/actions/workflows/run-tests.yml)\n[![Quality Score](https://img.shields.io/scrutinizer/g/spatie/calendar-links.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/calendar-links)\n[![Type coverage](https://shepherd.dev/github/spatie/calendar-links/coverage.svg)](https://shepherd.dev/github/spatie/calendar-links)\n[![Psalm level](https://shepherd.dev/github/spatie/calendar-links/level.svg)](https://shepherd.dev/github/spatie/calendar-links)\n\n\nUsing this package, you can generate links to add events to calendar systems. Here's a quick example:\n\n```php\nuse Spatie\\CalendarLinks\\Link;\n\nLink::create(\n    'Birthday',\n    DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 09:00'),\n    DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 18:00')\n)-\u003egoogle();\n```\n\nThis will output: `https://calendar.google.com/calendar/render?action=TEMPLATE\u0026text=Birthday\u0026dates=20180201T090000/20180201T180000\u0026sprop=\u0026sprop=name:`\n\nIf you follow that link (and are authenticated with Google), you’ll see a screen to add the event to your calendar.\n\nThe package can also generate ics files that you can open in several email and calendar programs, including Microsoft Outlook, Google Calendar, and Apple Calendar.\n\n## Support us\n\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/calendar-links.jpg?t=1\" width=\"419px\" /\u003e](https://spatie.be/github-ad-click/calendar-links)\n\nWe invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).\n\nWe highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).\n\n## Installation\n\nYou can install the package via composer:\n\n```sh\ncomposer require spatie/calendar-links\n```\n\n## Usage\n\n```php\n\u003c?php\nuse Spatie\\CalendarLinks\\Link;\n\n$from = DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 09:00');\n$to = DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 18:00');\n\n$link = Link::create('Sebastian’s birthday', $from, $to)\n    -\u003edescription('Cookies \u0026 cocktails!')\n    -\u003eaddress('Kruikstraat 22, 2018 Antwerpen');\n\n// Generate a link to create an event on Google calendar\necho $link-\u003egoogle();\n\n// Generate a link to create an event on Yahoo calendar\necho $link-\u003eyahoo();\n\n// Generate a link to create an event on outlook.live.com calendar\necho $link-\u003ewebOutlook();\n\n// Generate a link to create an event on outlook.office.com calendar\necho $link-\u003ewebOffice();\n\n// Generate a data URI for an ics file (for iCal \u0026 Outlook)\necho $link-\u003eics();\necho $link-\u003eics(['UID' =\u003e 'custom-id']); // Custom UID (to update existing events)\necho $link-\u003eics(['URL' =\u003e 'https://my-page.com']); // Custom URL\necho $link-\u003eics(['REMINDER' =\u003e []]); // Add the default reminder (for iCal \u0026 Outlook)\necho $link-\u003eics(['REMINDER' =\u003e ['DESCRIPTION' =\u003e 'Remind me', 'TIME' =\u003e new \\DateTime('tomorrow 12:30 UTC')]]); // Add a custom reminder\necho $link-\u003eics([], ['format' =\u003e 'file']); // use file output; e.g. to attach ics as a file to an email.\n\n// Generate a data URI using arbitrary generator:\necho $link-\u003eformatWith(new \\Your\\Generator());\n```\n\n## Package principles\n\n1. it should produce a small output (to keep page-size small)\n2. it should be fast (no any external heavy dependencies)\n3. all `Link` class features should be supported by at least 2 generators (different services have different features)\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information.\n\n## Testing\n\n```sh\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security\n\nIf you've found a bug regarding security, please mail [security@spatie.be](mailto:security@spatie.be) instead of using the issue tracker.\n\n## Postcardware\n\nYou're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment, we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.\n\nOur address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.\n\nWe publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).\n## Credits\n\n- [Sebastian De Deyne](https://github.com/sebastiandedeyne)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Fcalendar-links","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspatie%2Fcalendar-links","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Fcalendar-links/lists"}