# @capgo/capacitor-calendar 中文文档

规范地址：https://npmcn.com/package/%40capgo/capacitor-calendar/

版本：8\.0\.15
npm 元数据更新时间：2026-10-15T01:47:38.017Z
中文译文更新时间：2026-11-09T03:29:54.623Z
软件包许可：MPL-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40capgo/capacitor-calendar
原文对照：https://npmcn.com/package/%40capgo/capacitor-calendar/?lang=original
项目主页：https://capgo.app/docs/plugins/calendar/
源码仓库：https://github.com/Cap-go/capacitor-calendar

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1.5 MB，251 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：0 个
- peer 依赖：@capacitor/core \>=8\.0\.0
- 首次发布：2026-05-27T22:29:30.614Z
- 最新版本发布：2026-10-15T01:47:35.793Z
- 近 30 天下载量：47722（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：16（近 12 个月 16 个）

## 中文简介

在iOS和Android上管理日历事件的Capacitor插件,在iOS上提供提醒支持.

## 安装

```sh
npm install @capgo/capacitor-calendar
```

也可以使用：`pnpm add @capgo/capacitor-calendar`、`yarn add @capgo/capacitor-calendar`、`bun add @capgo/capacitor-calendar`

## README

# @ capgo/ 电容- calendar

从您的 Capacitor app 创建、 读取、 更新和删除日历事件, 或在 iOS 和 Android 上打开本地事件编辑器 。 在iOS上,您也可以完全访问提醒.

[![Capgo - Build Capacitor apps with AI, ship updates instantly](https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-calendar)](https://capgo.app/?ref=plugin_calendar)

**队长**:在几分钟内将修正推给您的 Capacitor 用户,在没有Mac的情况下构建已签名的iOS和Android apps,并在一击中回滚.

## [\*免费开始\*](https://capgo.app/register/?ref=plugin_calendar)

14天无限自由审判. 不需要信用卡

> 🤖 **建筑与AI编码代理?** 安装 [Capgo 技能](https://capgo.app/skills/?ref=plugin_calendar) 所以克劳德代码,代码,光标,副驾驶,或双子座CLI知道如何安装和使用 `@capgo/capacitor-calendar` 在您的电容应用程序中: `npx skills add Cap-go/capgo-skills`。然后问你的经纪人: _添加@capgo/capor-calendar到我的 Capacitor app上,并把它连接起来。"_ [代理设置指南](https://capgo.app/agents/?ref=plugin_calendar) • 妇女 [主机磁共振](https://capgo.app/docs/ai/mcp/?ref=plugin_calendar)

![iOS demo of the example app creating an event with the native calendar editor](https://raw.githubusercontent.com/Cap-go/capacitor-calendar/main/.github/assets/readme-demo.webp)

## 主要特点

-   **原生编辑器**数字 : `createEventWithPrompt()` 财务报告和审定财务报表 `modifyEventWithPrompt()` 打开系统事件编辑器. `deleteEventWithPrompt()` 请求确认, 并在 Android 上设置插件对话框 .
-   **事件 API**数字 : `createEvent()`, (中文(简体) ), `modifyEvent()`, (中文(简体) ), `deleteEvent()`, (中文(简体) ), `deleteEventsById()` 财务报告和审定财务报表 `listEventsInRange()`。 。 。 .
-   **日历**数字 : `listCalendars()`, (中文(简体) ), `getDefaultCalendar()`, (中文(简体) ), `createCalendar()`, (中文(简体) ), `modifyCalendar()` 财务报告和审定财务报表 `deleteCalendar()`。 。 。 .
-   **IOS 上的提醒**数字 : `createReminder()`, (中文(简体) ), `modifyReminder()`, (中文(简体) ), `getRemindersFromLists()` 还有更多.
-   **优劣权限**:只写和完整的日历访问,在Android上只读访问,外加提醒访问.
-   **平台**: iOS和Android. 互联网档案馆的存檔,存档日期2013-12-22. iOS 使用 EventKit, Android 使用 `CalendarContract`。提醒仅仅是iOS。 在网上不可用.

[![npm version](https://img.shields.io/npm/v/@capgo/capacitor-calendar.svg)](https://www.npmjs.com/package/@capgo/capacitor-calendar) [![npm downloads](https://img.shields.io/npm/dm/@capgo/capacitor-calendar.svg)](https://www.npmjs.com/package/@capgo/capacitor-calendar) [![license](https://img.shields.io/npm/l/@capgo/capacitor-calendar.svg)](https://npmcn.com/package/%40capgo/capacitor-calendar/LICENSE) [![Capacitor 8](https://img.shields.io/badge/Capacitor-8.x-119EFF.svg)](https://capacitorjs.com/)

Capacitor apps的本地日历和提醒访问. 使用它来请求日历权限,创建和编辑事件,打开系统日历UI,列出日历和事件,并在iOS上管理提醒.

此软件包是一个 Capgo 维护的日历插件版本, 最初由 Capgo 创建 [埃桑·巴罗尼](https://github.com/ebarooni/capacitor-calendar),并移植到 Capgo Capacitor 插件模板和 Capacitor 8.

## 目录

-   [安装](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-installation)
-   [演示](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-demo)
-   [设置](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-setup)
-   [快速启动](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-quick-start)
-   [常见食谱](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-common-recipes)
-   [平台支持](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-platform-support)
-   [兼容性](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-compatibility)
-   [文档](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-documentation)
-   [更改日志](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-changelog)
-   [API 密码](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-api)
-   [许可证和归属](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-license-and-attribution)

## 安装

您可以使用我们的 AI 辅助设置安装插件 。 使用以下命令将 Capgo 技能添加到您的 AI 工具 :

```bash
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins
```

然后使用下列提示:

```text
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-calendar` plugin in my project.
```

如果您更喜欢手动设置,请通过运行以下命令来安装插件,并遵循下面的平台特定指令:

```bash
npm install @capgo/capacitor-calendar
npx cap sync
```

## 演示

| iOS系统 | 机器人 |
| --- | --- |
| ![iOS demo of native calendar event creation](https://npmcn.com/package/%40capgo/capacitor-calendar/assets/demo/ios-demo.webp) | ![Android demo of native calendar event creation](https://npmcn.com/package/%40capgo/capacitor-calendar/assets/demo/android-demo.webp) |

## 设置

此插件使用本地日历 API,因此在运行时请求访问前,每个平台都需要权限配置.

官方平台参考文献:

-   [iOS: 迁移到最新的日历访问级别](https://developer.apple.com/documentation/technotes/tn3152-migrating-to-the-latest-calendar-access-levels)
-   [Android:日历提供者用户权限](https://developer.android.com/identity/providers/calendar-provider#manifest)

### iOS系统

添加您的应用程序需要的使用描述 `ios/App/App/Info.plist`. iOS 17和较新的区分只写和全日历访问.

```xml
<key>NSCalendarsUsageDescription</key>
<string>This app needs calendar access.</string>
<key>NSCalendarsWriteOnlyAccessUsageDescription</key>
<string>This app needs permission to add calendar events.</string>
<key>NSCalendarsFullAccessUsageDescription</key>
<string>This app needs permission to read and manage calendar events.</string>
<key>NSRemindersUsageDescription</key>
<string>This app needs reminders access.</string>
<key>NSRemindersFullAccessUsageDescription</key>
<string>This app needs permission to read and manage reminders.</string>
```

只包含匹配您的应用调用 API 的密钥 。 例如,一个只创建有只写访问的日历事件的应用程序不需要提醒键.

### 机器人

添加您的应用程序需要的权限 `android/app/src/main/AndroidManifest.xml`数字 :

```xml
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
```

然后在读取或写入日历数据前在运行时间请求匹配权限.

## 快速启动

```typescript
import { CapacitorCalendar } from '@capgo/capacitor-calendar';

const permission = await CapacitorCalendar.requestFullCalendarAccess();

if (permission.result !== 'granted') {
  throw new Error('Calendar permission was not granted');
}

const startDate = Date.now() + 60 * 60 * 1000;
const endDate = startDate + 60 * 60 * 1000;

const { id } = await CapacitorCalendar.createEvent({
  title: 'Product review',
  location: 'Capgo',
  startDate,
  endDate,
  description: 'Created with @capgo/capacitor-calendar',
});

console.log('Created event', id);
```

日期为Unix时间戳以毫秒为单位.

## 常见食谱

### 打开本地事件编辑器

```typescript
await CapacitorCalendar.createEventWithPrompt({
  title: 'Planning session',
  location: 'Office',
  startDate: Date.now() + 24 * 60 * 60 * 1000,
  endDate: Date.now() + 25 * 60 * 60 * 1000,
});
```

关于Android, `createEventWithPrompt` 财务报告和审定财务报表 `modifyEventWithPrompt` 总是返回 `null`。如果需要找到创建的事件 ID,则列出事件后的情况.

### 列出即将举行的活动

```typescript
const now = Date.now();
const oneWeekFromNow = now + 7 * 24 * 60 * 60 * 1000;

const { result: events } = await CapacitorCalendar.listEventsInRange({
  from: now,
  to: oneWeekFromNow,
});
```

### 选择日历

```typescript
const { result: calendars } = await CapacitorCalendar.listCalendars();
const { result: defaultCalendar } = await CapacitorCalendar.getDefaultCalendar();

const calendarId = defaultCalendar?.id ?? calendars[0]?.id;
```

`selectCalendarsWithPrompt` 可以在iOS上显示系统日历选择器.

### 创建 iOS 提醒

```typescript
const permission = await CapacitorCalendar.requestFullRemindersAccess();

if (permission.result === 'granted') {
  await CapacitorCalendar.createReminder({
    title: 'Send launch notes',
    dueDate: Date.now() + 2 * 24 * 60 * 60 * 1000,
    notes: 'Created with @capgo/capacitor-calendar',
  });
}
```

提醒 API 仅为 iOS .

## 平台支持

| 特性 | iOS系统 | 机器人 | 网页 |
| --- | --- | --- | --- |
| 许可检查和请求 | 对 | 对 | 没有 |
| 创建、修改、删除和列出事件 | 对 | 对 | 没有 |
| 本地事件创建、编辑和删除提示 | 对 | 对 | 没有 |
| 打开日历应用程序 | 对 | 对 | 没有 |
| 列出日历并获取默认日历 | 对 | 对 | 没有 |
| 日历来源 | 对 | 没有 | 没有 |
| 系统日历拾取器 | 对 | 没有 | 没有 |
| 创建、修改和删除日历 | 对 | 对 | 没有 |
| 提醒列表和提醒 CRUD | 对 | 没有 | 没有 |

网络执行仅作为Capacitor stub存在,并拒绝只使用本土的呼叫.

## 兼容性

| 插件版本 | 电容兼容性 | 维护 |
| --- | --- | --- |
| v8.x.x (中文(简体) ) | v8.x.x (中文(简体) ) | 对 |

## 文档

生成的API参考如下. 源类型定义在 [斜弧/定义.ts](https://npmcn.com/package/%40capgo/capacitor-calendar/src/definitions.ts),软件包主页是 [capgo.app/docs/插件/日历](https://capgo.app/docs/plugins/calendar/)。 。 。 .

关于与旧代码的兼容性, `requestPermission(...)` 财务报告和审定财务报表 `requestAllPermissions()` 现仍可提供。 新应用程序应该更喜欢 `requestWriteOnlyCalendarAccess()`, (中文(简体) ), `requestReadOnlyCalendarAccess()`, (中文(简体) ), `requestFullCalendarAccess()`,以及 `requestFullRemindersAccess()`。 。 。 .

## 更改日志

见 [变动情况](https://npmcn.com/package/%40capgo/capacitor-calendar/CHANGELOG.md) 用于发行笔记.

## 许可证和归属

这个软件包在MPL-2.0下发布. 原画 `@ebarooni/capacitor-calendar` ehsan Barooni在麻省理工学院下发布了项目;见 [第三次议会 NoTICES.md](https://npmcn.com/package/%40capgo/capacitor-calendar/THIRD_PARTY_NOTICES.md) 用于归属.

## API 密码

-   [`checkPermission(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-checkpermission)
-   [`checkAllPermissions()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-checkallpermissions)
-   [`requestPermission(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-requestpermission)
-   [`requestAllPermissions()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-requestallpermissions)
-   [`requestWriteOnlyCalendarAccess()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-requestwriteonlycalendaraccess)
-   [`requestReadOnlyCalendarAccess()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-requestreadonlycalendaraccess)
-   [`requestFullCalendarAccess()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-requestfullcalendaraccess)
-   [`requestFullRemindersAccess()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-requestfullremindersaccess)
-   [`createEventWithPrompt(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-createeventwithprompt)
-   [`modifyEventWithPrompt(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-modifyeventwithprompt)
-   [`createEvent(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-createevent)
-   [`modifyEvent(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-modifyevent)
-   [`deleteEventsById(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deleteeventsbyid)
-   [`deleteEvent(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deleteevent)
-   [`deleteEventWithPrompt(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deleteeventwithprompt)
-   [`listEventsInRange(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-listeventsinrange)
-   [`commit()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-commit)
-   [`selectCalendarsWithPrompt(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-selectcalendarswithprompt)
-   [`fetchAllCalendarSources()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-fetchallcalendarsources)
-   [`listCalendars()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-listcalendars)
-   [`getDefaultCalendar()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-getdefaultcalendar)
-   [`openCalendar(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-opencalendar)
-   [`createCalendar(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-createcalendar)
-   [`deleteCalendar(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deletecalendar)
-   [`modifyCalendar(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-modifycalendar)
-   [`fetchAllRemindersSources()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-fetchallreminderssources)
-   [`openReminders()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-openreminders)
-   [`getDefaultRemindersList()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-getdefaultreminderslist)
-   [`getRemindersLists()`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-getreminderslists)
-   [`createReminder(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-createreminder)
-   [`deleteRemindersById(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deleteremindersbyid)
-   [`deleteReminder(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deletereminder)
-   [`modifyReminder(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-modifyreminder)
-   [`getReminderById(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-getreminderbyid)
-   [`getRemindersFromLists(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-getremindersfromlists)
-   [`deleteReminderWithPrompt(...)`](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deletereminderwithprompt)
-   [接口](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-interfaces)
-   [类型异名](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-type-aliases)
-   [数字](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-enums)

### 检查许可(...)

```typescript
checkPermission(options: { scope: CalendarPermissionScope; }) => Promise<{ result: PermissionState; }>
```

为给定范围获取当前权限状态.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `{ scope: [CalendarPermissionScope](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-calendarpermissionscope); }` |

**回返情况:** `Promise<{ result: [PermissionState](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-permissionstate); }>`

**自:** 0.1.0 (中文(简体) )

* * *

### 检查所有许可( A)

```typescript
checkAllPermissions() => Promise<{ result: CheckAllPermissionsResult; }>
```

获取所有权限的当前状态 .

**回返情况:** `Promise<{ result: [CheckAllPermissionsResult](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-checkallpermissionsresult); }>`

**自:** 0.1.0 (中文(简体) )

* * *

### 请求许可(...)

```typescript
requestPermission(options: { scope: CalendarPermissionScope; }) => Promise<{ result: PermissionState; }>
```

请求准许某一范围.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `{ scope: [CalendarPermissionScope](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-calendarpermissionscope); }` |

**回返情况:** `Promise<{ result: [PermissionState](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-permissionstate); }>`

**自:** 0.1.0 (中文(简体) )

* * *

### 请求全部许可( )

```typescript
requestAllPermissions() => Promise<{ result: RequestAllPermissionsResult; }>
```

请求允许所有日历和提醒权限 .

**回返情况:** `Promise<{ result: [CheckAllPermissionsResult](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-checkallpermissionsresult); }>`

**自:** 0.1.0 (中文(简体) )

* * *

### 请求仅写 Calendar 访问 ()

```typescript
requestWriteOnlyCalendarAccess() => Promise<{ result: PermissionState; }>
```

请求写入日历 .

**回返情况:** `Promise<{ result: [PermissionState](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-permissionstate); }>`

**自:** 5.4.0 (单位:千美元)

* * *

### 请求只读 CalendarAccess ()

```typescript
requestReadOnlyCalendarAccess() => Promise<{ result: PermissionState; }>
```

请查看日历 .

**回返情况:** `Promise<{ result: [PermissionState](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-permissionstate); }>`

**自:** 5.4.0 (单位:千美元)

* * *

### 请求FullCalendar Access ()

```typescript
requestFullCalendarAccess() => Promise<{ result: PermissionState; }>
```

请求读取和写入日历.

**回返情况:** `Promise<{ result: [PermissionState](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-permissionstate); }>`

**自:** 5.4.0 (单位:千美元)

* * *

### 请求FulllReminders Access( )

```typescript
requestFullRemindersAccess() => Promise<{ result: PermissionState; }>
```

请求可读取和写入提醒.

**回返情况:** `Promise<{ result: [PermissionState](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-permissionstate); }>`

**自:** 5.4.0 (单位:千美元)

* * *

### 创建 Event With Prompt (...)

```typescript
createEventWithPrompt(options?: CreateEventWithPromptOptions | undefined) => Promise<{ id: string | null; }>
```

打开系统日历界面创建新事件. 在Android上,它总是返回 `null`; 获取事件以找到新创建的事件 ID.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[CreateEventWithPromptOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-createeventwithpromptoptions)` |

**回返情况:** `Promise<{ id: string | null; }>`

**自:** 0.1.0 (中文(简体) )

* * *

### 修改 Event With Prompt (...)

```typescript
modifyEventWithPrompt(options: ModifyEventWithPromptOptions) => Promise<{ result: EventEditAction | null; }>
```

打开系统日历界面来修改一个事件. 在Android上,它总是返回 `null`。 。 。 .

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[ModifyEventWithPromptOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-modifyeventwithpromptoptions)` |

**回返情况:** `Promise<{ result: [EventEditAction](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventeditaction) | null; }>`

**自:** 6.6.0 (简体中文)

* * *

### 创建 Event (...)

```typescript
createEvent(options: CreateEventOptions) => Promise<{ id: string; }>
```

在日历中创建事件.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[CreateEventOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-createeventoptions)` |

**回返情况:** `Promise<{ id: string; }>`

**自:** 0.4.0 (中文(简体) )

* * *

### 修改 Event (...)

```typescript
modifyEvent(options: ModifyEventOptions) => Promise<void>
```

修改一个事件.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[ModifyEventOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-modifyeventoptions)` |

**自:** 6.6.0 (简体中文)

* * *

### 删除 EventsById(...)

```typescript
deleteEventsById(options: DeleteEventsByIdOptions) => Promise<{ result: DeleteEventsByIdResult; }>
```

删除多个事件.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[DeleteEventsByIdOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deleteeventsbyidoptions)` |

**回返情况:** `Promise<{ result: [DeleteEventsByIdResult](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deleteeventsbyidresult); }>`

**自:** 0.11.0 (中文(简体) )

* * *

### 删除 Event (...)

```typescript
deleteEvent(options: DeleteEventOptions) => Promise<void>
```

删除事件.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[DeleteEventOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deleteeventoptions)` |

**自:** 7.1.0 (中文(简体) )

* * *

### 删除 Event With Prompt (...)

```typescript
deleteEventWithPrompt(options: DeleteEventWithPromptOptions) => Promise<{ deleted: boolean; }>
```

打开对话框删除事件.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[DeleteEventWithPromptOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deleteeventwithpromptoptions)` |

**回返情况:** `Promise<{ deleted: boolean; }>`

**自:** 7.1.0 (中文(简体) )

* * *

### 列表 Events In Range (...)

```typescript
listEventsInRange(options: ListEventsInRangeOptions) => Promise<{ result: CalendarEvent[]; }>
```

在一个日期范围内检索事件.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[ListEventsInRangeOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-listeventsinrangeoptions)` |

**回返情况:** `Promise<{ result: CalendarEvent[]; }>`

**自:** 0.10.0 (中文(简体) )

* * *

### 实施( )

```typescript
commit() => Promise<void>
```

保存等待的 iOS 日历更改 .

**自:** 7.1.0 (中文(简体) )

* * *

### 选择 Calendars With Prompt (...)

```typescript
selectCalendarsWithPrompt(options?: SelectCalendarsWithPromptOptions | undefined) => Promise<{ result: Calendar[]; }>
```

打开一个系统接口来选择一个或多个日历.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[SelectCalendarsWithPromptOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-selectcalendarswithpromptoptions)` |

**回返情况:** `Promise<{ result: Calendar[]; }>`

**自:** 0.2.0 (中文(简体) )

* * *

### 获取 AllCalendar 源代码 ()

```typescript
fetchAllCalendarSources() => Promise<{ result: CalendarSource[]; }>
```

获取日历源列表 .

**回返情况:** `Promise<{ result: CalendarSource[]; }>`

**自:** 6.6.0 (简体中文)

* * *

### 列表计数器( )

```typescript
listCalendars() => Promise<{ result: Calendar[]; }>
```

检索所有可用的日历 .

**回返情况:** `Promise<{ result: Calendar[]; }>`

**自:** 7.1.0 (中文(简体) )

* * *

### 获得默认日历( C)

```typescript
getDefaultCalendar() => Promise<{ result: Calendar | null; }>
```

获取默认日历 .

**回返情况:** `Promise<{ result: [Calendar](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-calendar) | null; }>`

**自:** 0.3.0 (中文(简体) )

* * *

### 打开日历(...)

```typescript
openCalendar(options?: OpenCalendarOptions | undefined) => Promise<void>
```

打开日历应用程序.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[OpenCalendarOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-opencalendaroptions)` |

**自:** 7.1.0 (中文(简体) )

* * *

### 创建 Calendar (...)

```typescript
createCalendar(options: CreateCalendarOptions) => Promise<{ id: string; }>
```

创建日历.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[CreateCalendarOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-createcalendaroptions)` |

**回返情况:** `Promise<{ id: string; }>`

**自:** 5.2.0 (中文(简体) )

* * *

### 删除日历(...)

```typescript
deleteCalendar(options: DeleteCalendarOptions) => Promise<void>
```

用 ID 删除日历.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[DeleteCalendarOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deletecalendaroptions)` |

**自:** 5.2.0 (中文(简体) )

* * *

### 修改日历(...)

```typescript
modifyCalendar(options: ModifyCalendarOptions) => Promise<void>
```

修改日历 .

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[ModifyCalendarOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-modifycalendaroptions)` |

**自:** 7.2.0 联合国

* * *

### 获取 AllReminders 来源( )

```typescript
fetchAllRemindersSources() => Promise<{ result: CalendarSource[]; }>
```

获取提醒来源列表 .

**回返情况:** `Promise<{ result: CalendarSource[]; }>`

**自:** 6.6.0 (简体中文)

* * *

### 打开复刻器( )

```typescript
openReminders() => Promise<void>
```

打开提醒应用程序.

**自:** 7.1.0 (中文(简体) )

* * *

### 获取默认Reminders列表 ()

```typescript
getDefaultRemindersList() => Promise<{ result: RemindersList | null; }>
```

获取默认提醒列表.

**回返情况:** `Promise<{ result: [Calendar](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-calendar) | null; }>`

**自:** 7.1.0 (中文(简体) )

* * *

### 获取Reminders 列表 ()

```typescript
getRemindersLists() => Promise<{ result: RemindersList[]; }>
```

获取所有可用的提醒列表.

**回返情况:** `Promise<{ result: Calendar[]; }>`

**自:** 7.1.0 (中文(简体) )

* * *

### 创建 Reminder (...)

```typescript
createReminder(options: CreateReminderOptions) => Promise<{ id: string; }>
```

创建提醒.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[CreateReminderOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-createreminderoptions)` |

**回返情况:** `Promise<{ id: string; }>`

**自:** 0.5.0 (单位:千美元)

* * *

### 删除RemindersById(...)

```typescript
deleteRemindersById(options: DeleteRemindersByIdOptions) => Promise<{ result: DeleteRemindersByIdResult; }>
```

删除多个提醒.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[DeleteRemindersByIdOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deleteremindersbyidoptions)` |

**回返情况:** `Promise<{ result: [DeleteRemindersByIdResult](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deleteremindersbyidresult); }>`

**自:** 5.3.0 (中文(简体) )

* * *

### 删除Reminder(...)

```typescript
deleteReminder(options: DeleteReminderOptions) => Promise<void>
```

删除提醒.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[DeleteReminderOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deletereminderoptions)` |

**自:** 7.1.0 (中文(简体) )

* * *

### 修改Reminder(...)

```typescript
modifyReminder(options: ModifyReminderOptions) => Promise<void>
```

修改一个教诲.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[ModifyReminderOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-modifyreminderoptions)` |

**自:** 6.7.0 (简体中文)

* * *

### 获取ReminderById(...)

```typescript
getReminderById(options: GetReminderByIdOptions) => Promise<{ result: Reminder | null; }>
```

用身份证获取提醒 .

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[GetReminderByIdOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-getreminderbyidoptions)` |

**回返情况:** `Promise<{ result: [Reminder](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-reminder) | null; }>`

**自:** 7.1.0 (中文(简体) )

* * *

### 获取 Reminders fromLists (...)

```typescript
getRemindersFromLists(options: GetRemindersFromListsOptions) => Promise<{ result: Reminder[]; }>
```

从多个列表获取提醒 .

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[GetRemindersFromListsOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-getremindersfromlistsoptions)` |

**回返情况:** `Promise<{ result: Reminder[]; }>`

**自:** 5.3.0 (中文(简体) )

* * *

### 删除 Reminder With Prompt (...)

```typescript
deleteReminderWithPrompt(options: DeleteReminderWithPromptOptions) => Promise<{ deleted: boolean; }>
```

打开对话框删除提醒.

| 参数 | 类型 |
| --- | --- |
| **`options`** | `[DeleteReminderWithPromptOptions](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-deletereminderwithpromptoptions)` |

**回返情况:** `Promise<{ deleted: boolean; }>`

**自:** 7.2.0 联合国

* * *

### 接口

#### 创建带有Prompt 选项的事件

| Prop | 类型 | 说明 | 自兹 |
| --- | --- | --- | --- |
| **`alerts`** | `number[]` | 相对于事件开始,警告时间为分钟。 开始前使用负数提醒;开始后使用正数提醒。 iOS上只支持2个警报. | 7.1.0 (中文(简体) ) |
| **`availability`** | `[EventAvailability](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventavailability)` |  | 7.1.0 (中文(简体) ) |
| **`calendarId`** | `string` |  | 0.1.0 (中文(简体) ) |
| **`description`** | `string` |  | 7.1.0 (中文(简体) ) |
| **`endDate`** | `number` |  | 0.1.0 (中文(简体) ) |
| **`invitees`** | `string[]` | 要邀请的一系列电子邮件 . | 7.1.0 (中文(简体) ) |
| **`isAllDay`** | `boolean` |  | 0.1.0 (中文(简体) ) |
| **`location`** | `string` |  | 0.1.0 (中文(简体) ) |
| **`recurrence`** | `[EventRecurrenceRule](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventrecurrencerule)` | 建立经常性活动的规则. | 7.3.0 (单位:千美元) |
| **`startDate`** | `number` |  | 0.1.0 (中文(简体) ) |
| **`title`** | `string` |  | 0.1.0 (中文(简体) ) |
| **`url`** | `string` |  | 0.1.0 (中文(简体) ) |

#### 重犯规则

| Prop | 类型 | 说明 | 默认 | 自兹 |
| --- | --- | --- | --- | --- |
| **`byMonth`** | `number[]` | 将每年的复发限制在一年的特定月份。 数值应在1至12之间. |  | 7.1.0 (中文(简体) ) |
| **`byMonthDay`** | `number[]` | 将每月的复发时间限制在每月的具体天数。 数值应在1至31之间. |  | 7.1.0 (中文(简体) ) |
| **`byWeekDay`** | `number[]` | 将每周的复发限制为特定工作日。 数值应为1至7. 1为星期一和7为星期日. |  | 7.3.0 (单位:千美元) |
| **`count`** | `number` | 总出事数. 如果设定, 重现会在此众多事件之后结束 。 若为 `count` 提供, `end` 被忽略. |  | 7.3.0 (单位:千美元) |
| **`daysOfTheYear`** | `number[]` | 将每年的复发时间限制在一年中的特定天数(1至366). |  | 7.3.0 (单位:千美元) |
| **`end`** | `number` | 以毫秒为单位作为Unix时间戳的重现系列结束日期. |  | 7.1.0 (中文(简体) ) |
| **`frequency`** | `[RecurrenceFrequency](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-recurrencefrequency)` | 事件多频繁地重复. |  | 7.3.0 (单位:千美元) |
| **`interval`** | `number` | 复发间隔 。 结合使用 `frequency`例如,一个间隔为2个的每周活动导致每两周发生一次. | `1` | 7.3.0 (单位:千美元) |
| **`weeksOfTheYear`** | `number[]` | 将每年的重复次数限制在ISO周的具体数目(1至53个). |  | 7.3.0 (单位:千美元) |

#### 修改“ 快速” 选项

| Prop | 类型 | 说明 | 自兹 |
| --- | --- | --- | --- |
| **`id`** | `string` | 要修改的事件标识 . | 7.1.0 (中文(简体) ) |

#### 创建事件选项

| Prop | 类型 | 说明 | 默认 | 自兹 |
| --- | --- | --- | --- | --- |
| **`alerts`** | `number[]` | 相对于事件开始,警告时间为分钟。 启动前使用负数警告,启动后使用正数警告. |  | 7.1.0 (中文(简体) ) |
| **`attendees`** | `EventGuest[]` | 活动嘉宾. |  | 7.1.0 (中文(简体) ) |
| **`availability`** | `[EventAvailability](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventavailability)` |  |  | 7.1.0 (中文(简体) ) |
| **`calendarId`** | `string` |  |  | 0.1.0 (中文(简体) ) |
| **`color`** | `string` |  |  | 7.1.0 (中文(简体) ) |
| **`commit`** | `boolean` | 是否立即保存( I)`true`)或以后的分批更改(`false`) (中文(简体) ). | `true` | 7.1.0 (中文(简体) ) |
| **`description`** | `string` |  |  | 7.1.0 (中文(简体) ) |
| **`duration`** | `string` | 活动期间采用RFC2445格式. |  | 7.1.0 (中文(简体) ) |
| **`endDate`** | `number` |  |  | 0.1.0 (中文(简体) ) |
| **`isAllDay`** | `boolean` |  |  | 0.1.0 (中文(简体) ) |
| **`location`** | `string` |  |  | 0.1.0 (中文(简体) ) |
| **`organizer`** | `string` | 活动组织者的电子邮件. |  | 7.1.0 (中文(简体) ) |
| **`recurrence`** | `[EventRecurrenceRule](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventrecurrencerule)` | 建立经常性活动的规则. |  | 7.3.0 (单位:千美元) |
| **`startDate`** | `number` |  |  | 0.1.0 (中文(简体) ) |
| **`title`** | `string` |  |  | 0.4.0 (中文(简体) ) |
| **`url`** | `string` |  |  | 0.1.0 (中文(简体) ) |

#### 事件嘉宾

| Prop | 类型 | 自兹 |
| --- | --- | --- |
| **`name`** | `string` | 7.1.0 (中文(简体) ) |
| **`email`** | `string` | 7.1.0 (中文(简体) ) |

#### 修改事件选项

| Prop | 类型 | 说明 | 默认 | 自兹 |
| --- | --- | --- | --- | --- |
| **`alerts`** | `number[]` | 相对于事件开始,警告时间为分钟。 启动前使用负数警告,启动后使用正数警告. |  | 7.1.0 (中文(简体) ) |
| **`attendees`** | `EventGuest[]` | 活动嘉宾. |  | 7.1.0 (中文(简体) ) |
| **`availability`** | `[EventAvailability](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventavailability)` |  |  | 7.1.0 (中文(简体) ) |
| **`calendarId`** | `string` |  |  | 0.1.0 (中文(简体) ) |
| **`color`** | `string` |  |  | 7.1.0 (中文(简体) ) |
| **`description`** | `string` |  |  | 7.1.0 (中文(简体) ) |
| **`duration`** | `string` | 活动期间采用RFC2445格式. |  | 7.1.0 (中文(简体) ) |
| **`endDate`** | `number` |  |  | 0.1.0 (中文(简体) ) |
| **`id`** | `string` | 要修改的事件标识 . |  | 7.1.0 (中文(简体) ) |
| **`isAllDay`** | `boolean` |  |  | 0.1.0 (中文(简体) ) |
| **`location`** | `string` |  |  | 0.1.0 (中文(简体) ) |
| **`recurrence`** | `[EventRecurrenceRule](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventrecurrencerule)` | 建立经常性活动的规则. |  | 7.3.0 (单位:千美元) |
| **`organizer`** | `string` | 活动组织者的电子邮件. |  | 7.1.0 (中文(简体) ) |
| **`span`** | `[EventSpan](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventspan)` | 修改范围. | `EventSpan.THIS_EVENT` |  |
| **`startDate`** | `number` |  |  | 0.1.0 (中文(简体) ) |
| **`title`** | `string` |  |  | 0.4.0 (中文(简体) ) |
| **`url`** | `string` |  |  | 0.1.0 (中文(简体) ) |

#### 删除事件ById结果

| Prop | 类型 | 自兹 |
| --- | --- | --- |
| **`deleted`** | `string[]` | 7.1.0 (中文(简体) ) |
| **`failed`** | `string[]` | 7.1.0 (中文(简体) ) |

#### 删除事件ById 选项

| Prop | 类型 | 说明 | 默认 | 自兹 |
| --- | --- | --- | --- | --- |
| **`ids`** | `string[]` |  |  | 7.1.0 (中文(简体) ) |
| **`span`** | `[EventSpan](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventspan)` | 删除的跨度 . | `EventSpan.THIS_EVENT` |  |

#### 删除选项

| Prop | 类型 | 说明 | 默认 | 自兹 |
| --- | --- | --- | --- | --- |
| **`id`** | `string` |  |  | 7.1.0 (中文(简体) ) |
| **`span`** | `[EventSpan](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventspan)` | 删除的跨度 . | `EventSpan.THIS_EVENT` |  |

#### 删除带有Prompt选项的Event

| Prop | 类型 | 说明 | 默认 | 自兹 |
| --- | --- | --- | --- | --- |
| **`id`** | `string` |  |  | 7.1.0 (中文(简体) ) |
| **`span`** | `[EventSpan](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventspan)` | 删除的跨度 . | `EventSpan.THIS_EVENT` |  |
| **`title`** | `string` | 对话框的标题 . |  | 7.1.0 (中文(简体) ) |
| **`message`** | `string` | 对话框的消息 . |  | 7.1.0 (中文(简体) ) |
| **`confirmButtonText`** | `string` | 在确认按钮上显示的文本 . | `'Delete'` | 7.1.0 (中文(简体) ) |
| **`cancelButtonText`** | `string` | 在取消按钮上显示的文本 . | `'Cancel'` | 7.1.0 (中文(简体) ) |

#### 日历事件

| Prop | 类型 | 说明 | 自兹 |
| --- | --- | --- | --- |
| **`id`** | `string` |  | 7.1.0 (中文(简体) ) |
| **`title`** | `string` |  | 7.1.0 (中文(简体) ) |
| **`calendarId`** | `string | null` |  | 7.1.0 (中文(简体) ) |
| **`location`** | `string | null` |  | 7.1.0 (中文(简体) ) |
| **`startDate`** | `number` |  | 7.1.0 (中文(简体) ) |
| **`endDate`** | `number` |  | 7.1.0 (中文(简体) ) |
| **`isAllDay`** | `boolean` |  | 7.1.0 (中文(简体) ) |
| **`alerts`** | `number[]` | 相对于事件开始,警告时间为分钟. | 7.1.0 (中文(简体) ) |
| **`url`** | `string | null` |  | 7.1.0 (中文(简体) ) |
| **`description`** | `string | null` |  | 7.1.0 (中文(简体) ) |
| **`availability`** | `[EventAvailability](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventavailability) | null` |  | 7.1.0 (中文(简体) ) |
| **`organizer`** | `string | null` |  | 7.1.0 (中文(简体) ) |
| **`color`** | `string | null` |  | 7.1.0 (中文(简体) ) |
| **`duration`** | `string | null` |  | 7.1.0 (中文(简体) ) |
| **`isDetached`** | `boolean | null` |  | 7.1.0 (中文(简体) ) |
| **`birthdayContactIdentifier`** | `string | null` |  | 7.1.0 (中文(简体) ) |
| **`status`** | `[EventStatus](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-eventstatus) | null` |  | 7.1.0 (中文(简体) ) |
| **`creationDate`** | `number | null` |  | 7.1.0 (中文(简体) ) |
| **`lastModifiedDate`** | `number | null` |  | 7.1.0 (中文(简体) ) |
| **`attendees`** | `{ email: string | null; name: string | null; role: [AttendeeRole](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-attendeerole) | null; status: [AttendeeStatus](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-attendeestatus) | null; type: [AttendeeType](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-attendeetype) | null; }[]` |  | 7.1.0 (中文(简体) ) |
| **`timezone`** | `string | null` |  | 7.1.0 (中文(简体) ) |

#### 列出在远程选项中的事件

| Prop | 类型 | 说明 | 自兹 |
| --- | --- | --- | --- |
| **`from`** | `number` | 时间戳在毫秒. | 7.1.0 (中文(简体) ) |
| **`to`** | `number` | 时间戳在毫秒. | 7.1.0 (中文(简体) ) |

#### 日历

| Prop | 类型 | 说明 | 自兹 |
| --- | --- | --- | --- |
| **`id`** | `string` |  | 7.1.0 (中文(简体) ) |
| **`title`** | `string` |  | 7.1.0 (中文(简体) ) |
| **`internalTitle`** | `string | null` | 日历的内部名称( N)`CalendarContract.Calendars.NAME`) (中文(简体) ). | 7.1.0 (中文(简体) ) |
| **`color`** | `string` |  | 7.1.0 (中文(简体) ) |
| **`isImmutable`** | `boolean | null` |  | 7.1.0 (中文(简体) ) |
| **`allowsContentModifications`** | `boolean | null` |  | 7.1.0 (中文(简体) ) |
| **`type`** | `[CalendarType](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-calendartype) | null` |  | 7.1.0 (中文(简体) ) |
| **`isSubscribed`** | `boolean | null` |  | 7.1.0 (中文(简体) ) |
| **`source`** | `[CalendarSource](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-calendarsource) | null` |  | 7.1.0 (中文(简体) ) |
| **`visible`** | `boolean | null` | 指示是否显示本日历中的事件 . | 7.1.0 (中文(简体) ) |
| **`accountName`** | `string | null` | 登记日历的账户. | 7.1.0 (中文(简体) ) |
| **`ownerAccount`** | `string | null` | 历之所主. | 7.1.0 (中文(简体) ) |
| **`maxReminders`** | `number | null` | 允许每次事件的最大提醒次数 . | 7.1.0 (中文(简体) ) |
| **`location`** | `string | null` |  | 7.1.0 (中文(简体) ) |

#### 日历来源

| Prop | 类型 | 自兹 |
| --- | --- | --- |
| **`type`** | `[CalendarSourceType](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-calendarsourcetype)` | 7.1.0 (中文(简体) ) |
| **`id`** | `string` | 7.1.0 (中文(简体) ) |
| **`title`** | `string` | 7.1.0 (中文(简体) ) |

#### 选择带有Prompt选项的算法

| Prop | 类型 | 说明 | 默认 | 自兹 |
| --- | --- | --- | --- | --- |
| **`displayStyle`** | `[CalendarChooserDisplayStyle](https://npmcn.com/package/%40capgo/capacitor-calendar/#readme-calendarchooserdisplaystyle)` |  | `CalendarChooserDisplayStyle.ALL_CALENDARS` | 7.1.0 (中文(简体) ) |
| **`multiple`** | `boolean` | 允许多个选择 . | `false` | 7.1.0 (中文(简体) ) |

#### OpenCalendar 选项

| Prop | 类型 | 默认 | 自兹 |
| --- | --- | --- | --- |
| **`date`** | `number` | `Date.now()` | 7.1.0 (中文(简体) ) |

#### 创建算法选项

| Prop | 类型 | 说明 | 自兹 |
| --- | --- | --- | --- |
| **`title`** | `string` |  | 5.2.0 (中文(简体) ) |
| **`color`** | `string` | 历所取之色. 应该提供Android. | 5.2.0 (中文(简体) ) |
| **`sourceId`** | `string` |  | 5.2.0 (中文(简体) ) |
| **`accountName`** | `string` | 只有Android需要这个 通常设置为电子邮件地址 . | 7.1.0 (中文(简体) ) |
| **`ownerAccount`** | `string` | 只有Android需要这个 通常设置为电子邮件地址 . | 7.1.0 (中文(简体) ) |

#### 删除计时器选项

| Prop | 类型 | 自兹 |
| --- | --- | --- |
| **`id`** | `string` | 7.1.0 (中文(简体) ) |

#### 修改日历选项

| Prop | 类型 | 自兹 |
| --- | --- | --- |
| **`id`** | `string` | 7.2.0 联合国 |
| **`title`** | `string` | 7.2.0 联合国 |
| **`color`** | `string` | 7.2.0 联合国 |

#### 创建重命名选项

| Prop | 类型 | 说明 | 自兹 |
| --- | --- | --- | --- |
| **`title`** | `string` |  | 7.1.0 (中文(简体) ) |
| **`listId`** | `string` |  | 7.1.0 (中文(简体) ) |
| **`priority`** | `number` |  | 7.1.0 (中文(简体) ) |
| **`isCompleted`** | `boolean` |  | 7.1.0 (中文(简体) ) |
| **`startDate`** | `number` |  | 7.1.0 (中文(简体) ) |
| **`dueDate`** | `number` |  |  |

## 常见问题

### @capgo/capacitor-calendar 是什么？

在iOS和Android上管理日历事件的Capacitor插件,在iOS上提供提醒支持\.

### 如何安装 @capgo/capacitor-calendar？

在项目目录运行 npm install @capgo/capacitor-calendar，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@capacitor/core（\>=8\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @capgo/capacitor-calendar 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @capgo/capacitor-calendar 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @capgo/capacitor-calendar 可以商用吗？

@capgo/capacitor-calendar 使用 MPL-2\.0 许可。弱 Copyleft：可以商用，也可以和闭源代码一起使用；但如果分发时修改了 MPL 授权的文件，这些文件的修改需以 MPL 开源。以上为概括，不构成法律意见，请以许可原文为准。

### @capgo/capacitor-calendar 的下载量有多少？

根据 npm 官方下载统计，@capgo/capacitor-calendar 在 2026/10/09 – 2026/11/07 这 30 天内被下载 47,722 次，日均约 1,591 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @capgo/capacitor-calendar 还在维护吗？

最新版本 8\.0\.15 发布于 2026/10/15（25 天前）；至今共发布 16 个版本，其中过去 12 个月发布了 16 个；首次发布于 2026/05/28。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

