Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@ebarooni/capacitor-calendar
Advanced tools
The Capacitor Calendar Plugin exposes functionalities for interacting with the calendar of iOS and Android devices.
This CapacitorJS plugin simplifies the process of managing calendar events within your hybrid mobile applications. With CRUD functionalities (Create, Read, Update, Delete), you can seamlessly interact with the device's native calendar directly from your app.
https://capacitor-calendar.pages.dev
npm install @ebarooni/capacitor-calendar
npx cap sync
Platform | range |
---|---|
iOS | ≥ 13 |
Android | ≥ 7 (SDK 24 or Nougat) |
iOS 17 | Android 14 |
---|---|
On iOS, readCalendar
permission is not needed when you are creating an event using the native prompt.
The video is just for showing the functionality, otherwise the createEventWithPrompt
method works without the readCalendar
authorization.
To be able to use the plugin, you will need to add the required permissions to your app. The required platform-specific permissions can be found below:
checkPermission(...)
checkAllPermissions()
requestPermission(...)
requestAllPermissions()
createEventWithPrompt()
selectCalendarsWithPrompt(...)
listCalendars()
getDefaultCalendar()
createEvent(...)
checkPermission(options: { alias: keyof CalendarPermissionStatus; }) => Promise<{ result: PermissionState; }>
Checks the current authorization status of a specific permission.
Param | Type | Description |
---|---|---|
options | { alias: keyof CalendarPermissionStatus; } | An object with the name of the permission |
Returns: Promise<{ result: PermissionState; }>
checkAllPermissions() => Promise<CalendarPermissionStatus>
Checks the current authorization status of all the required permissions for the plugin.
Returns: Promise<CalendarPermissionStatus>
requestPermission(options: { alias: keyof CalendarPermissionStatus; }) => Promise<{ result: PermissionState; }>
Requests authorization to a specific permission, if not already granted. If the permission is already granted, it will directly return the status.
Param | Type | Description |
---|---|---|
options | { alias: keyof CalendarPermissionStatus; } | An object with the name of the permission |
Returns: Promise<{ result: PermissionState; }>
requestAllPermissions() => Promise<CalendarPermissionStatus>
Requests authorization to all the required permissions for the plugin, if they have not already been granted.
Returns: Promise<CalendarPermissionStatus>
createEventWithPrompt() => Promise<{ eventCreated: boolean; }>
Creates an event in the calendar by using the native calendar. On iOS opens a native sheet and on Android opens an intent. This method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed. On Android, the user has to authorize for read access.
Returns: Promise<{ eventCreated: boolean; }>
selectCalendarsWithPrompt(options: { displayStyle: CalendarChooserDisplayStyle; selectionStyle: CalendarChooserSelectionStyle; }) => Promise<{ result: Calendar[]; }>
Presents a prompt to the user to select calendars. This method is available only on iOS.
Param | Type | Description |
---|---|---|
options | { displayStyle: CalendarChooserDisplayStyle; selectionStyle: CalendarChooserSelectionStyle; } | - Options for customizing the display and selection styles of the calendar chooser. |
Returns: Promise<{ result: Calendar[]; }>
listCalendars() => Promise<{ result: Calendar[]; }>
Retrieves a list of calendars available on the device.
Returns: Promise<{ result: Calendar[]; }>
getDefaultCalendar() => Promise<{ result: Calendar; }>
Retrieves the default calendar set on the device.
Returns: Promise<{ result: Calendar; }>
createEvent(options: { title: string; calendarId?: string; location?: string; startDate?: Date; endDate?: Date; isAllDay?: boolean; }) => Promise<{ eventCreated: boolean; }>
Creates an event with the provided options.
Param | Type | Description |
---|---|---|
options | { title: string; calendarId?: string; location?: string; startDate?: Date; endDate?: Date; isAllDay?: boolean; } | - Options for creating the event. |
Returns: Promise<{ eventCreated: boolean; }>
Describes the permission status for reading from the calendar.
Prop | Type |
---|---|
readCalendar | PermissionState |
writeCalendar | PermissionState |
Represents a calendar object with an ID and title.
Prop | Type |
---|---|
id | string |
title | string |
Enables basic storage and retrieval of dates and times.
Method | Signature | Description |
---|---|---|
toString | () => string | Returns a string representation of a date. The format of the string depends on the locale. |
toDateString | () => string | Returns a date as a string value. |
toTimeString | () => string | Returns a time as a string value. |
toLocaleString | () => string | Returns a value as a string value appropriate to the host environment's current locale. |
toLocaleDateString | () => string | Returns a date as a string value appropriate to the host environment's current locale. |
toLocaleTimeString | () => string | Returns a time as a string value appropriate to the host environment's current locale. |
valueOf | () => number | Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. |
getTime | () => number | Gets the time value in milliseconds. |
getFullYear | () => number | Gets the year, using local time. |
getUTCFullYear | () => number | Gets the year using Universal Coordinated Time (UTC). |
getMonth | () => number | Gets the month, using local time. |
getUTCMonth | () => number | Gets the month of a Date object using Universal Coordinated Time (UTC). |
getDate | () => number | Gets the day-of-the-month, using local time. |
getUTCDate | () => number | Gets the day-of-the-month, using Universal Coordinated Time (UTC). |
getDay | () => number | Gets the day of the week, using local time. |
getUTCDay | () => number | Gets the day of the week using Universal Coordinated Time (UTC). |
getHours | () => number | Gets the hours in a date, using local time. |
getUTCHours | () => number | Gets the hours value in a Date object using Universal Coordinated Time (UTC). |
getMinutes | () => number | Gets the minutes of a Date object, using local time. |
getUTCMinutes | () => number | Gets the minutes of a Date object using Universal Coordinated Time (UTC). |
getSeconds | () => number | Gets the seconds of a Date object, using local time. |
getUTCSeconds | () => number | Gets the seconds of a Date object using Universal Coordinated Time (UTC). |
getMilliseconds | () => number | Gets the milliseconds of a Date, using local time. |
getUTCMilliseconds | () => number | Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). |
getTimezoneOffset | () => number | Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). |
setTime | (time: number) => number | Sets the date and time value in the Date object. |
setMilliseconds | (ms: number) => number | Sets the milliseconds value in the Date object using local time. |
setUTCMilliseconds | (ms: number) => number | Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). |
setSeconds | (sec: number, ms?: number | undefined) => number | Sets the seconds value in the Date object using local time. |
setUTCSeconds | (sec: number, ms?: number | undefined) => number | Sets the seconds value in the Date object using Universal Coordinated Time (UTC). |
setMinutes | (min: number, sec?: number | undefined, ms?: number | undefined) => number | Sets the minutes value in the Date object using local time. |
setUTCMinutes | (min: number, sec?: number | undefined, ms?: number | undefined) => number | Sets the minutes value in the Date object using Universal Coordinated Time (UTC). |
setHours | (hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => number | Sets the hour value in the Date object using local time. |
setUTCHours | (hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => number | Sets the hours value in the Date object using Universal Coordinated Time (UTC). |
setDate | (date: number) => number | Sets the numeric day-of-the-month value of the Date object using local time. |
setUTCDate | (date: number) => number | Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). |
setMonth | (month: number, date?: number | undefined) => number | Sets the month value in the Date object using local time. |
setUTCMonth | (month: number, date?: number | undefined) => number | Sets the month value in the Date object using Universal Coordinated Time (UTC). |
setFullYear | (year: number, month?: number | undefined, date?: number | undefined) => number | Sets the year of the Date object using local time. |
setUTCFullYear | (year: number, month?: number | undefined, date?: number | undefined) => number | Sets the year value in the Date object using Universal Coordinated Time (UTC). |
toUTCString | () => string | Returns a date converted to a string using Universal Coordinated Time (UTC). |
toISOString | () => string | Returns a date as a string value in ISO format. |
toJSON | (key?: any) => string | Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. |
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
Members | Description |
---|---|
ALL_CALENDARS | Display all calendars available for selection. |
WRITABLE_CALENDARS_ONLY | Display only writable calendars available for selection. |
Members | Description |
---|---|
SINGLE | Allows only a single selection in the calendar chooser. |
MULTIPLE | Allows multiple selections in the calendar chooser. |
FAQs
The Capacitor Calendar Plugin enables full calendar functionality on iOS and Android, with added reminder support for iOS devices.
The npm package @ebarooni/capacitor-calendar receives a total of 1,620 weekly downloads. As such, @ebarooni/capacitor-calendar popularity was classified as popular.
We found that @ebarooni/capacitor-calendar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.