From f54fb08757c7d26c07ae943d725598d49bdd90fa Mon Sep 17 00:00:00 2001 From: Eddy Verbruggen Date: Sat, 29 Oct 2016 18:14:54 +0200 Subject: [PATCH] #10 Assertion failure --- README.md | 10 ++++++++++ calendar.ios.js | 4 ++-- calendar.d.ts => index.d.ts | 0 package.json | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) rename calendar.d.ts => index.d.ts (100%) diff --git a/README.md b/README.md index 82cee8e..71df42a 100755 --- a/README.md +++ b/README.md @@ -26,6 +26,16 @@ You can provide your own reason for accessing the calendar by adding something l _To not crash your app in case you forgot to provide the reason this plugin adds an empty reason to the `.plist` during build. This value gets overridden by anything you specified yourself. You're welcome._ +## TypeScript Usage +Of course you can use this plugin with TypeScript, just import the plugin and use +the functions summed up below like this: + +```js +import * as Calendar from "nativescript-calendar"; + +// example for listCalendars: +Calendar.listCalendars().then(/* .. */); +``` ## Usage diff --git a/calendar.ios.js b/calendar.ios.js index 500021b..181561f 100755 --- a/calendar.ios.js +++ b/calendar.ios.js @@ -286,11 +286,11 @@ Calendar.createEvent = function (arg) { } if (calendar === null) { // create it - calendar = EKCalendar.calendarForEntityTypeEventStore("EKEntityTypeEvent", Calendar._eventStore); + calendar = EKCalendar.calendarForEntityTypeEventStore(EKEntityTypeEvent, Calendar._eventStore); calendar.title = settings.calendar.name; if (false && settings.calendar.color !== null) { // TODO hex to UIColor - calendar.CGColor = settings.calendar.color; + // calendar.CGColor = settings.calendar.color; } calendar.source = Calendar._findEKSource(); Calendar._eventStore.saveCalendarCommitError(calendar, true, null); diff --git a/calendar.d.ts b/index.d.ts similarity index 100% rename from calendar.d.ts rename to index.d.ts diff --git a/package.json b/package.json index eaf24f5..7e3e8e9 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "nativescript-calendar", - "version": "1.1.2", + "version": "1.1.3", "description": "Interact with the native calendar. Add, Update, Read, you name it.", "main": "calendar.js", + "typings": "index.d.ts", "nativescript": { "platforms": { "android": "2.0.0",