|
廃止 |
|
2010/08/10 |
|
createEvent |
CalendarEvent |
カレンダー内に新規のイベントを作成する |
|
openByName |
Calendar |
指定された名前でオーナーのカレンダーを開く |
|
openByEmailAddress |
Calendar |
指定されたメルアドレスでオーナーのカレンダーを開く |
createAllDayEvent(title, date)
| Arguments : |
| name | Type | 説明 |
|
title | String |
イベントのタイトル |
|
date | Date |
イベントの日付
|
| 動作確認用サンプル : |
// スプレッドシートのタイトル(A1セル)と日付(B1セル)を取得してカレンダーに終日イベントを追加
// B1セルに設定した日の一日前に追加されてしまう(タイムゾーンの関係)ので 時間調整が必要
function createAllDayEvent() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var title = sheet.getRange("A1").getValue();
var startDate = sheet.getRange("B1").getValue();
var allDayEventDate = new Date(startDate.getTime() + 86400000); // 日付(時間)の調整用
var cal = CalendarApp.getDefaultCalendar();
cal.createAllDayEvent(title, allDayEventDate);
}
|
20101023
createAllDayEvent(title, date, optAdvancedArgs)
| Arguments : |
| name | Type | 説明 |
|
title | String |
イベントのタイトル |
|
date | Date |
イベントの日付 |
|
optAdvancedArgs | Object |
未定義
|
| Advanced Arguments* : |
| name | Type | 説明 |
|
description | String |
イベントの説明 |
|
location | String |
イベントの場所 |
|
guests | String |
ゲストのメール(カンマ区切り) |
|
sendInvites | bool |
ゲストにメールを送信するかどうか
|
| 動作確認用サンプル : |
//終日イベントを追加する
//調整方法を検討中です!このままでは日付が正確に指定できません。
function createEvent() {
var cal = CalendarApp.getDefaultCalendar();
cal.createAllDayEvent("createEvent-Test4", new Date("February 1, 2011")
, {description:"時刻設定を検証",location:'自宅'});
}
|
20110201
createAllDayEventSeries(title, startDate, recurrence, optAdvancedArgs)
| Argument : |
| member | Type | 説明 |
|
title |
String |
イベントのタイトル |
|
startDate |
Date |
繰り返すイベントの開始日 |
|
recurrence |
Recurrence |
繰り返す必要のあるイベントルールの表現;CalendarApp.newRecurrence()を参照 |
|
optAdvancedArgs |
Object |
引数が以下のセクションで定義されたJavaScriptのオブジェクトフィールド |
| Advanced Argument : |
| member | Type | 説明 |
|
description |
String |
イベントの説明 |
|
location |
String |
イベントの場所 |
|
location |
String |
イベントに招待されたゲストのメールアドレスリスト(スプレッドシートカンマ区切り) |
|
sendInvites |
Boolean |
falseが設定された場合招待状がゲストに送られない |
createEvent(title, startDate, endDate, optAdvancedArgs)
-
新規のカレンダーイベントを作成する
カレンダーイベントを返す:作成できない場合はnullを返す
( 参考 :getEvents )
| Argument : |
| member | Type | 説明 |
|
title |
String |
新規イベントのタイトル |
|
startDate |
Date |
イベントの開始日と開始時刻 |
|
endDate |
Date |
イベントの終了日と終了時刻 |
|
optAdvancedArgs |
Object |
引数が以下のセクションで定義されたJavaScriptのオブジェクトフィールド |
| Advanced Argument : |
| member | Type | 説明 |
|
description |
String |
新規イベントの説明 |
|
guests |
String |
イベントに招待されたゲストのメールアドレスリスト(スプレッドシートカンマ区切り) |
|
location |
String |
イベントの場所 |
|
sendInvites |
bool |
falseが設定された場合招待状がゲストに送られない |
| Googleのサンプル : |
// The code below will add an event to the user's default Calendar
var cal = CalendarApp.getDefaultCalendar();
cal.createEvent("Busy", new Date("July 21, 2010 08:00:00 EST"), new Date("July 21, 2010 09:00:00 EST"), {location:'Nap room'});
|
| 動作確認用サンプル : |
//デファルトのカレンダーにイベントを追加する
// ”GMT+09”の設定で時刻を調整
function createEvent() {
var cal = CalendarApp.getDefaultCalendar();
cal.createEvent("createEvent-Test4", new Date("February 1, 2011 20:00:00 GMT+09")
, new Date("February 1, 2011 21:00:00 GMT+09")
, {description:"時刻設定を検証",location:'自宅'});
}
|
20110201
createEventFromDescription(description)
| Arguments : |
| name | Type | 説明 |
|
description | String |
イベントについての説明(フリーなテキスト)
|
| Googleのサンプル : |
CalendarApp.getDefaultCalendar().createEventFromDescription("Lunch with Mary, 2PM on Feburary 2nd");
|
| 動作確認用サンプル : |
// 引数の内容をカレンダーに追加
// イベントはスクリプトを実行した日として追加される(時刻が反映されている!)
function crateEvent(){
CalendarApp.getDefaultCalendar().createEventFromDescription("メンバーと会食, 5PM 10月31日(日)");
}
|
20101023
createEventSeries(title, startTime, endTime, recurrence, optAdvancedArgs)
-
カレンダーにおいてEventSeriesを作成する。CalendarEventSeriesを返す。イベントが作成できない場合はnullを返す。
( 参考 :getEvents)
| Argument : |
| member | Type | 説明 |
|
title |
String |
イベントのタイトル |
|
startDate |
Date |
繰り返すイベントの開始日 |
|
startDate |
Date |
繰り返すイベントの終了日 |
|
recurrence |
Recurrence |
繰り返す必要のあるイベントルールの表現;CalendarApp.newRecurrence()を参照 |
|
optAdvancedArgs |
Object |
引数が以下のセクションで定義されたJavaScriptのオブジェクトフィールド |
| Advanced Argument : |
| member | Type | 説明 |
|
description |
String |
イベントの説明 |
|
location |
String |
イベントの場所 |
|
location |
String |
イベントに招待されたゲストのメールアドレスリスト(スプレッドシートカンマ区切り) |
|
sendInvites |
Boolean |
falseが設定された場合招待状がゲストに送られない |
// The code below will add an event to the user's default Calendar that recurs every other day
var cal = CalendarApp.getDefaultCalendar();
cal.createEvent("Busy", new Date("July 21, 2010 08:00:00 EST"),
new Date("July 21, 2010 09:00:00 EST"),
CalendarApp.newRecurrence().addDailyRule().interval(2), {location:'Nap room'});
|
deleteCalendar()
getColor()
-
このカレンダーの表示に使われているカラーを取得する
( 参考 :setColor)
| 戻り値 : |
| Type | 説明 |
|
color |
カレンダーのカラー色
|
getDescription()
| 戻り値 : |
| Type | 説明 |
|
String |
カレンダーの説明
|
getEvents(startDate, endDate, optStatus)
-
カレンダー内で指定期間内すべてのイベントを取得する
CalendarEventオブジェクトの配列を返す。オブジェクトは指定した時間範囲で開始または終了の時刻を持つ。指定された時間の範囲内でイベントが発見されない場合は空の配列を返す。もしオプションのパラメーターが指定された時は、呼び出しユーザーの指定されたステータスのあるイベントだけが返される。
| Arguments : |
| name | Type | 説明 |
|
startDate | Date |
期間内の開始日時
| |
endDate | Date |
期間内の終了日時 |
|
optStatus | String |
出席状態は{"はい"|"いいえ"|"たぶん"|"招待"|} ("Yes" | "No" | "Maybe" | "Invited")を表示
|
| サンプル : |
// The code below will retrieve all the events for the user's default calendar and
// display the description of the first event
var cal = CalendarApp.getDefaultCalendar();
var events = cal.getEvents(new Date("July 21, 2009 EST"), new Date("July 22, 2009 EST"));
if (events[0]) {
Browser.msgBox(events[0].getDescription());
}
|
// The code below will retrieve all the events for the user's default calendar, that the
// user has accepted, and display the description of the first event
var cal = CalendarApp.getDefaultCalendar();
var events = cal.getEvents(new Date("July 21, 2009 EST"), new Date("July 22, 2009 EST"), "Yes");
if (events[0]) {
Browser.msgBox(events[0].getDescription());
}
|
getEvents(startTime, endTime)
| Arguments : |
| name | Type | 説明 |
|
startTime | Date |
範囲の開始時刻を返す |
|
endTime | Date |
範囲の終了時刻を返す
|
getEvents(startTime, endTime, statusFilters)
| Arguments : |
| name | Type | 説明 |
|
startDate | Date |
期間内の開始日時
| |
endDate | Date |
期間内の終了日時 |
|
statusFilters | GuestStatus[ ] |
希望するステータス
|
| サンプル : |
CalendarApp.getDefaultCalendar().getEvents(new Date("May 1, 2010"), new Date("May 7, 2010"),
[CalendarApp.Attendance.OWNER, CalendarApp.Attendance.YES]);
|
getEventsForDay(date)
-
一日のすべてのイベントの取得
Dateオブジェクトの日付部分だけが使用され、時刻は無視される
( 参考 :getEvents)
| Arguments : |
| name | Type | 説明 |
|
date | Date |
イベントのために取得する日
|
|