Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Calendar map support #170

Closed
wants to merge 3 commits into from
Closed

Conversation

focux
Copy link

@focux focux commented Oct 21, 2019

Close #157

This PR adds support for Apple's Calendar Map. I added a new property to the event model called appleLocation. This is the interface of that new property:

    interface AppleLocationData {
      title: string;
      address: string;
      radius: number;
      geo: GeoData;
    }

    interface GeoData {
      lat: number;
      lon: number;
    }

I decided to doesn't allow the use of location and appleLocation in the same event, because, if they don't have the same title and address, the map won't work. So, if you use the appleLocation property, it'll create under the hood the location and the X-APPLE-STRUCTURED-LOCATION, this way, it will always match.

e.g. This object

{
  ...
  appleLocation: {
    title: 'My Title',
    address: 'My Address',
    radius: 40,
    geo: {
      lat: '52.063921',
      lon: '5.128511',
    }
  ...
}

Will output this:

...
LOCATION:My Title\nMy Address
X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-ADDRESS=My Address;X-APPLE-
 RADIUS=40;X-TITLE=My Title:geo:52.063921,5.128511
...

This PR also contain the type definitions for this implementation, although I missed the test and the docs.

@sebbo2002
Copy link
Owner

sebbo2002 commented Oct 23, 2019

  • Unit Tests
  • Documentation

sebbo2002 added a commit that referenced this pull request Apr 13, 2020
commit de16a66
Author: Sebastian Pekarek <mail@sebbo.net>
Date:   Mon Apr 13 15:04:39 2020 +0200

    docs(README): Add Apple Location method

commit d8b176f
Author: Sebastian Pekarek <mail@sebbo.net>
Date:   Mon Apr 13 15:04:16 2020 +0200

    test(Event): Apple Location tests

commit aa840b8
Merge: 8e5f3b6 6e351b3
Author: Sebastian Pekarek <mail@sebbo.net>
Date:   Mon Apr 13 14:27:54 2020 +0200

    Merge branch 'apple-event-feature' of https://github.com/focux/ical-generator into feature/apple-calendar

commit 6e351b3
Author: Leonardo Dominguez <focuux@gmail.com>
Date:   Mon Oct 21 15:59:47 2019 -0400

    fix: location and apple location must match

commit 28a0b15
Author: Leonardo Dominguez <focuux@gmail.com>
Date:   Mon Oct 21 15:26:45 2019 -0400

    fix types and line break

commit 10b8014
Author: Leonardo Dominguez <focuux@gmail.com>
Date:   Mon Oct 21 15:05:55 2019 -0400

    🙌 implement apple event tag
@sebbo2002
Copy link
Owner

Just released ical-generator v1.10.0 with this feature. Thanks again.

@sebbo2002 sebbo2002 closed this Apr 13, 2020
sebbo2002 pushed a commit that referenced this pull request Feb 27, 2021
# [1.3.0-develop.1](v1.2.1...v1.3.0-develop.1) (2021-02-27)

### Bug Fixes

* **package.json:** add temporary version ([0bc117e](0bc117e))
* allow X-attrs to be specified in constructor ([#185](#185)) ([58c1ae5](58c1ae5))
* capitalize byDay even when bySetPos is used ([#205](#205)) ([5440fbc](5440fbc))
* **Typings:** Fix OPT-PARTICIPANT ([b777f9e](b777f9e)), closes [#192](#192)
* Fix scale type for CalendarData ([#191](#191)) ([d5421e8](d5421e8))
* Make x key optional in types ([#211](#211)) ([e3c21e2](e3c21e2))
* Type fixes and updates ([#217](#217)) ([d8abe4d](d8abe4d))

### Features

* **Events:** Add appleLocation method ([#170](#170)) ([0956ba2](0956ba2))
* Add missing string input options to interface ([#199](#199)) ([a963178](a963178))
* Add Transparency Method ([bd2901d](bd2901d))
* Increase id entropy - Fixes [#200](#200) ([#202](#202)) ([6711b0a](6711b0a))
* make domain optional ([#209](#209)) ([e3362c9](e3362c9))
* Updated the entire codebase to Typescript ([d013dc0](d013dc0))
* **Events:** use provided timezone when constructing repeating.exclude ([#210](#210)) ([bd84230](bd84230))
This was referenced Apr 10, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apple Calendar app support
2 participants