addEvent(event, options)

デバイスのカレンダーに行動を追加します。

構文 

1import { getCalendarService } from 'lightning/mobileCapabilities';
2addEvent(event: Event,
3  options: CalendarServiceOptions
4  ): Promise<Object>

パラメータ 

  • event — (必須) デバイスのカレンダーに追加される Event オブジェクト。
  • options — CalendarService 要求を設定するための CalendarServiceOptions オブジェクト。

戻り値 

Event パラメータの設定済みバージョンとして解決される Promise オブジェクトです。エラーが発生した場合は、エラーメッセージが返されます。

使用方法 

この関数は、デバイスのカレンダーに行動を追加するために使用します。

1myCalendarService
2  .addEvent(event, options)
3  .then((results) => {
4    this.addedEvent = results;
5  })
6  .catch((error) => {
7    console.error("Error code: " + error.code);
8    +console.error("Error message: " + error.message);
9  });

CalendarService が行動データを設定する (変更する) タイミングとその理由についての詳細は、「暗黙のデータ設定」を参照してください。

関連トピック

The Japanese Summer '24 guide is now live

日本語の Summer '24 ガイドが公開されました! 「Component Reference (コンポーネントリファレンス)」は、以前と同様にコンポーネントライブラリにあります。