Office.SeriesTime interface
The SeriesTime
object provides methods to get and set the dates and times of appointments in a recurring series and get the dates and times of meeting requests in a recurring series.
Remarks
Minimum permission level: read item
Applicable Outlook mode: Compose or Read
Methods
get |
Gets the duration in minutes of a usual instance in a recurring appointment series. |
get |
Gets the end date of a recurrence pattern in the following ISO 8601 date format: "YYYY-MM-DD". |
get |
Gets the end time of a usual appointment or meeting request instance of a recurrence pattern in whichever time zone that the user or add-in set the recurrence pattern using the following ISO 8601 format: "THH:mm:ss:mmm". |
get |
Gets the start date of a recurrence pattern in the following ISO 8601 date format: "YYYY-MM-DD". |
get |
Gets the start time of a usual appointment instance of a recurrence pattern in whichever time zone that the user/add-in set the recurrence pattern using the following ISO 8601 format: "THH:mm:ss:mmm". |
set |
Sets the duration of all appointments in a recurrence pattern. This will also change the end time of the recurrence pattern. |
set |
Sets the end date of a recurring appointment series. |
set |
Sets the end date of a recurring appointment series. |
set |
Sets the start date of a recurring appointment series. |
set |
Sets the start date of a recurring appointment series. |
set |
Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set (the item's time zone is used by default). |
set |
Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set (the item's time zone is used by default). |
Method Details
getDuration()
Gets the duration in minutes of a usual instance in a recurring appointment series.
getDuration(): number;
Returns
number
Remarks
Minimum permission level: read item
Applicable Outlook mode: Compose or Read
Examples
// This example gets the duration of a usual instance in a recurring appointment series.
Office.context.mailbox.item.recurrence.getAsync(callback);
function callback(asyncResult) {
const context = asyncResult.context;
const recurrence = asyncResult.value;
const duration = recurrence.seriesTime.getDuration();
}
getEndDate()
Gets the end date of a recurrence pattern in the following ISO 8601 date format: "YYYY-MM-DD".
getEndDate(): string;
Returns
string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Compose or Read
Examples
// This example gets the end date of a recurring appointment series.
Office.context.mailbox.item.recurrence.getAsync(callback);
function callback(asyncResult) {
const context = asyncResult.context;
const recurrence = asyncResult.value;
const endDate = recurrence.seriesTime.getEndDate();
}
getEndTime()
Gets the end time of a usual appointment or meeting request instance of a recurrence pattern in whichever time zone that the user or add-in set the recurrence pattern using the following ISO 8601 format: "THH:mm:ss:mmm".
getEndTime(): string;
Returns
string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Compose or Read
Examples
// This example gets the end time of a usual instance in a recurring appointment series.
Office.context.mailbox.item.recurrence.getAsync(callback);
function callback(asyncResult) {
const context = asyncResult.context;
const recurrence = asyncResult.value;
const endDate = recurrence.seriesTime.getEndTime();
}
getStartDate()
Gets the start date of a recurrence pattern in the following ISO 8601 date format: "YYYY-MM-DD".
getStartDate(): string;
Returns
string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Compose or Read
Examples
// This example gets the start date of a recurring appointment series.
Office.context.mailbox.item.recurrence.getAsync(callback);
function callback(asyncResult) {
const context = asyncResult.context;
const recurrence = asyncResult.value;
const endDate = recurrence.seriesTime.getStartDate();
}
getStartTime()
Gets the start time of a usual appointment instance of a recurrence pattern in whichever time zone that the user/add-in set the recurrence pattern using the following ISO 8601 format: "THH:mm:ss:mmm".
getStartTime(): string;
Returns
string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Compose or Read
Examples
// This example gets the start time of a usual
// instance in a recurring appointment series.
const seriesTimeObject = new SeriesTime();
seriesTimeObject.setDuration(120);
setDuration(minutes)
Sets the duration of all appointments in a recurrence pattern. This will also change the end time of the recurrence pattern.
setDuration(minutes: number): void;
Parameters
- minutes
-
number
The length of the appointment in minutes.
Returns
void
Remarks
Minimum permission level: read/write item
Applicable Outlook mode: Compose
Examples
// This example sets the duration of each appointment
// in a recurring series to 2 hours.
Office.context.mailbox.item.recurrence.getAsync(callback);
function callback(asyncResult) {
const context = asyncResult.context;
const recurrence = asyncResult.value;
const endDate = recurrence.seriesTime.getStartTime();
}
setEndDate(year, month, day)
Sets the end date of a recurring appointment series.
setEndDate(year: number, month: number, day: number): void;
Parameters
- year
-
number
The year value of the end date.
- month
-
number
The month value of the end date. Valid range is 0-11 where 0 represents the 1st month and 11 represents the 12th month.
- day
-
number
The day value of the end date.
Returns
void
Remarks
Minimum permission level: read/write item
Applicable Outlook mode: Compose
Examples
// This example sets the end date of a recurring
// appointment series to November 2, 2017.
const seriesTimeObject = new SeriesTime();
seriesTimeObject.setEndDate(2017, 10, 2);
setEndDate(date)
Sets the end date of a recurring appointment series.
setEndDate(date: string): void;
Parameters
- date
-
string
End date of the recurring appointment series represented in the ISO 8601 date format: "YYYY-MM-DD".
Returns
void
Remarks
Minimum permission level: read/write item
Applicable Outlook mode: Compose
Examples
// This example sets the end date of a
// recurring appointment series to November 2, 2017
// using ISO 8601 date standard.
const seriesTimeObject = new SeriesTime()
seriesTimeObject.setEndDate("2017-11-02");
setStartDate(year, month, day)
Sets the start date of a recurring appointment series.
setStartDate(year:number, month:number, day:number): void;
Parameters
- year
-
number
The year value of the start date.
- month
-
number
The month value of the start date. Valid range is 0-11 where 0 represents the 1st month and 11 represents the 12th month.
- day
-
number
The day value of the start date.
Returns
void
Remarks
Minimum permission level: read/write item
Applicable Outlook mode: Compose
Examples
// This example sets the start date of a recurring
// appointment series to November 2, 2017.
const seriesTimeObject = new SeriesTime();
seriesTimeObject.setStartDate(2017, 10, 2);
setStartDate(date)
Sets the start date of a recurring appointment series.
setStartDate(date:string): void;
Parameters
- date
-
string
Start date of the recurring appointment series represented in the ISO 8601 date format: "YYYY-MM-DD".
Returns
void
Remarks
Minimum permission level: read/write item
Applicable Outlook mode: Compose
Examples
// This example sets the start date of a recurring
// appointment series to November 2, 2017
// using ISO 8601 date standard.
const seriesTimeObject = new SeriesTime()
seriesTimeObject.setStartDate("2017-11-02");
setStartTime(hours, minutes)
Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set (the item's time zone is used by default).
setStartTime(hours: number, minutes: number): void;
Parameters
- hours
-
number
The hour value of the start time. Valid range: 0-24.
- minutes
-
number
The minute value of the start time. Valid range: 0-59.
Returns
void
Remarks
Minimum permission level: read/write item
Applicable Outlook mode: Compose
Examples
// This example sets the start time of each instance
// of a recurring appointment series to 1:30 PM.
const seriesTimeObject = new SeriesTime();
seriesTimeObject.setStartTime(13, 30);
// This example sets the start time of each instance
// of a recurring appointment series to 11:30 AM.
seriesTimeObject.setStartTime(11, 30);
setStartTime(time)
Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set (the item's time zone is used by default).
setStartTime(time: string): void;
Parameters
- time
-
string
Start time of all instances represented by standard datetime string format: "THH:mm:ss:mmm".
Returns
void
Remarks
Minimum permission level: read/write item
Applicable Outlook mode: Compose
Examples
// This example sets the start time of each instance
// of a recurring appointment series to 11:30 PM.
const seriesTimeObject = new SeriesTime()
seriesTimeObject.setStartTime("T23:30:00");
Office Add-ins