Office.MailboxEnums.Days enum
指定星期几或日期类型。
注解
适用的 Outlook 模式:撰写或阅读
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/50-recurrence/get-set-recurrence-appointment-organizer.yaml
// Important: Can only set the recurrence pattern of an appointment series.
const currentDate = new Date();
let seriesTimeObject: Office.SeriesTime;
// Set series start date to tomorrow.
seriesTimeObject.setStartDate(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDay() + 1);
// Set series end date to one year from now.
seriesTimeObject.setEndDate(currentDate.getFullYear() + 1, currentDate.getMonth() + 1, currentDate.getDay());
// Set start time to 1:30 PM.
seriesTimeObject.setStartTime(13, 30);
// Set duration to 30 minutes.
seriesTimeObject.setDuration(30);
const pattern: Office.Recurrence = {
seriesTime: seriesTimeObject,
recurrenceType: Office.MailboxEnums.RecurrenceType.Yearly,
recurrenceProperties: {
interval: 1,
dayOfWeek: Office.MailboxEnums.Days.Tue,
weekNumber: Office.MailboxEnums.WeekNumber.Second,
month: Office.MailboxEnums.Month.Sep
},
recurrenceTimeZone: { name: Office.MailboxEnums.RecurrenceTimeZone.PacificStandardTime }
};
Office.context.mailbox.item.recurrence.setAsync(pattern, (asyncResult) => {
if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Failed to set recurrence. Error: ${asyncResult.error.message}`);
return;
}
console.log(`Succeeded in setting recurrence pattern ${JSON.stringify(pattern)}`);
});
字段
Mon = "mon" | 星期一 |
Tue = "tue" | 星期二 |
Wed = "wed" | 星期三 |
Thu = "thu" | 星期四 |
Fri = "fri" | 星期五 |
Sat = "sat" | 星期六 |
Sun = "sun" | 星期日 |
Weekday = "weekday" | 周 (不包括周末) :“星期一”、“星期二”、“星期三”、“星期四”和“星期五”。 |
WeekendDay = "weekendDay" | 周末:“星期六”和“太阳”。 |
Day = "day" | 星期几。 |