2017 © Pedro PelĂĄez
 

library calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

image

spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  • Monday, July 23, 2018
  • by Spatie
  • Repository
  • 8 Watchers
  • 154 Stars
  • 9,523 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 13 Forks
  • 5 Open issues
  • 13 Versions
  • 58 % Grown

The README.md

Generate add to calendar links for Google, iCal and other calendar systems

Latest Version on Packagist Total Downloads Test Quality Score Type coverage Psalm level, (*1)

Using this package, you can generate links to add events to calendar systems. Here's a quick example:, (*2)

use Spatie\CalendarLinks\Link;

Link::create(
    'Birthday',
    DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 09:00'),
    DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 18:00')
)->google();

This will output: https://calendar.google.com/calendar/render?action=TEMPLATE&text=Birthday&dates=20180201T090000/20180201T180000&sprop=&sprop=name:, (*3)

If you follow that link (and are authenticated with Google), you’ll see a screen to add the event to your calendar., (*4)

The package can also generate ics files that you can open in several email and calendar programs, including Microsoft Outlook, Google Calendar, and Apple Calendar., (*5)

Support us

, (*6)

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products., (*7)

We 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. We publish all received postcards on our virtual postcard wall., (*8)

Installation

You can install the package via composer:, (*9)

composer require spatie/calendar-links

Usage

<?php
use Spatie\CalendarLinks\Link;

$from = DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 09:00');
$to = DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 18:00');

$link = Link::create('Sebastian’s birthday', $from, $to)
    ->description('Cookies & cocktails!')
    ->address('Kruikstraat 22, 2018 Antwerpen');

// Generate a link to create an event on Google calendar
echo $link->google();

// Generate a link to create an event on Yahoo calendar
echo $link->yahoo();

// Generate a link to create an event on outlook.live.com calendar
echo $link->webOutlook();

// Generate a link to create an event on outlook.office.com calendar
echo $link->webOffice();

// Generate a data URI for an ics file (for iCal & Outlook)
echo $link->ics();
echo $link->ics(['UID' => 'custom-id']); // Custom UID (to update existing events)
echo $link->ics(['URL' => 'https://my-page.com']); // Custom URL
echo $link->ics(['REMINDER' => []]); // Add the default reminder (for iCal & Outlook)
echo $link->ics(['REMINDER' => ['DESCRIPTION' => 'Remind me', 'TIME' => new \DateTime('tomorrow 12:30 UTC')]]); // Add a custom reminder
echo $link->ics([], ['format' => 'file']); // use file output; e.g. to attach ics as a file to an email.

// Generate a data URI using arbitrary generator:
echo $link->formatWith(new \Your\Generator());

Package principles

  1. it should produce a small output (to keep page-size small)
  2. it should be fast (no any external heavy dependencies)
  3. all Link class features should be supported by at least 2 generators (different services have different features)

Changelog

Please see CHANGELOG for more information., (*10)

Testing

composer test

Contributing

Please see CONTRIBUTING for details., (*11)

Security

If you've found a bug regarding security, please mail security@spatie.be instead of using the issue tracker., (*12)

Postcardware

You're free to use this package (it's MIT-licensed), 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., (*13)

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium., (*14)

We publish all received postcards on our company website., (*15)

Credits

License

The MIT License (MIT). Please see License File for more information., (*16)

The Versions

23/07 2018

dev-master

9999999-dev https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

23/07 2018

1.0.3

1.0.3.0 https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

15/05 2018

1.0.2

1.0.2.0 https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

15/05 2018

dev-Viktorminator-master

dev-Viktorminator-master https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

15/05 2018

dev-analysis-zDdeWk

dev-analysis-zDdeWk https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

15/05 2018

dev-ical-issue

dev-ical-issue https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

15/05 2018

dev-analysis-zdGm0Z

dev-analysis-zdGm0Z https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

30/04 2018

1.0.1

1.0.1.0 https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

30/04 2018

dev-analysis-8w26Zo

dev-analysis-8w26Zo https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

28/09 2017

1.0.0

1.0.0.0 https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

28/09 2017

0.1.1

0.1.1.0 https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

28/09 2017

0.1.0

0.1.0.0 https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links

17/09 2017

0.0.1

0.0.1.0 https://github.com/spatie/calendar-links

Generate add to calendar links for Google, iCal and other calendar systems

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

spatie calendar-links