Introduction | calendar-links-rust | Spatie       

 SPATIE  

calendar-links-rust
===================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Calendar-links-rust](https://spatie.be/docs/calendar-links-rust/v1)  Introduction

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/calendar-links-rust/v1) 

  Introduction    
- [ Introduction ](https://spatie.be/docs/calendar-links-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/calendar-links-rust/v1/support-us)
- [ Installation ](https://spatie.be/docs/calendar-links-rust/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/calendar-links-rust/v1/usage)
- [ Testing ](https://spatie.be/docs/calendar-links-rust/v1/testing)
- [ Changelog ](https://spatie.be/docs/calendar-links-rust/v1/changelog)

  Calendar-links-rust 
=====================

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

### Useful links

- [Repository](https://github.com/spatie/calendar-links-rust)
- [Discussions](https://github.com/spatie/calendar-links-rust/discussions)

Introduction
------------

###  On this page 

1. [ Package principles ](#content-package-principles)

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

```
use spatie_calendar_links::Link;

Link::create(
    "Birthday party",
    "2027-03-15T10:00[Europe/Brussels]".parse()?,
    "2027-03-15T17:00[Europe/Brussels]".parse()?,
)?.google();
```

This will output:

```
https://calendar.google.com/calendar/render?action=TEMPLATE&dates=20270315T100000/20270315T170000&ctz=Europe/Brussels&text=Birthday+party
```

Give both dates an explicit timezone, as above. The `ctz` parameter is taken from the start date.

Name a place (`Europe/Brussels`, or an alias of one such as `Japan` or `US/Pacific`) rather than an offset. Neither an offset nor an abbreviation gives a calendar service a place to resolve. The same goes for the IANA entries that stand for no place: the POSIX rule sets (`EST`, `MST7MDT`), the other spellings of UTC, and the whole `Etc/GMT±N` family, which Google rejects outright and whose sign runs the opposite way from the offset it names. Those events are written in UTC instead (`dates=20270315T090000Z/20270315T160000Z`, with no `ctz`, and a UTC `DTSTART` in the ics file), so they land at the right instant everywhere, but the calendar has no zone to follow when the daylight saving rules of that place change. The `Etc/` tree is refused in full, `Etc/UTC` included, so pass `UTC` when you want a UTC endpoint alongside a named zone, since a refused zone at either end of a two zone event sends both ends to the fallback.

Dates use [`jiff::Zoned`](https://docs.rs/jiff/0.2/jiff/struct.Zoned.html), re-exported through `spatie_calendar_links::jiff`. A named date uses the `2027-03-15T10:00[Europe/Brussels]` syntax; a bare offset uses `2027-03-15T10:00+01:00[+01:00]`. Use an explicit offset for an abbreviation such as `CEST`, rather than relying on a date parser to guess its meaning.

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

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.

Package principles
--------------------------------------------------------------------------------------------------------------

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

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
