branch: externals/excorporate commit f59702d98db1a793bbba74691aeb07e4af660d2d Author: Thomas Fitzsimmons <fitz...@fitzsim.org> Commit: Thomas Fitzsimmons <fitz...@fitzsim.org>
Specify time zone during item creation * excorporate.el (excorporate-time-zone): Require excorporate-time-zone. (excorporate-time-zone): New defcustom. (exco-calendar-item-meeting-create) (exco-calendar-item-appointment-create): Specify start time zone. * excorporate.texi (API Usage): Mention exco-time-zone. --- excorporate.el | 15 +++++++++++++++ excorporate.texi | 5 ++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/excorporate.el b/excorporate.el index a1a3320..49ace9c 100644 --- a/excorporate.el +++ b/excorporate.el @@ -122,6 +122,7 @@ (require 'fsm) (require 'excorporate-calendar) (require 'org) +(require 'excorporate-time-zone) (defgroup excorporate nil "Exchange support." @@ -143,6 +144,18 @@ interactive functions, `excorporate-diary-disable' and `excorporate-diary-enable'." :type 'boolean) +(defcustom excorporate-time-zone nil + "The server-style time zone. +If this variable is nil, Excorporate will compute a time zone +automatically based on `current-time-zone'. If that doesn't +work, or you want to specify the time zone directly, run +`excorporate-customize-time-zone' to customize this variable from +a list of valid values." + :type '(choice :menu-tag "Server-style time zone" + :tag "Server-style time zone" + (const :tag "Compute from Emacs time zone" nil) + string)) + ;; For Office 365, URLs containing autodiscover-s.outlook.com do not ;; seem to work properly (the returned XML gives ErrorCode 600). (defconst exco--autodiscovery-templates @@ -753,6 +766,7 @@ creation." (CalendarItem (Subject . ,subject) (Body (BodyType . "Text") ,body) + (StartTimeZone (Id . ,(exco-time-zone))) (Start . ,(exco-format-date-time start)) (End . ,(exco-format-date-time end)) (Location . ,location) @@ -831,6 +845,7 @@ appointment creation." (CalendarItem (Subject . ,subject) (Body (BodyType . "Text") ,body) + (StartTimeZone (Id . ,(exco-time-zone))) (Start . ,(exco-format-date-time start)) (End . ,(exco-format-date-time end))))) nil nil nil nil) diff --git a/excorporate.texi b/excorporate.texi index c9e943e..3390c19 100644 --- a/excorporate.texi +++ b/excorporate.texi @@ -435,7 +435,9 @@ the asynchronous calls to avoid blocking Emacs during server operations. @noindent Here is a more complicated example that asynchronously queries the server for availability overlap for hacker1@@gnu.org and -hacker2@@gnu.org, in the Eastern Time time zone. +hacker2@@gnu.org, in the America/Toronto time zone. Call +@code{exco-time-zone} to calculate, from Emacs's internal time zone (see +@code{current-time-zone}), the equivalent server time zone string. @example @group @@ -469,6 +471,7 @@ hacker2@@gnu.org, in the Eastern Time time zone. (ExcludeConflicts . nil))) (FreeBusyViewOptions (TimeWindow + (StartTimeZone (Id . "Eastern Standard Time")) (StartTime . "2020-09-25T00:00:00Z") (EndTime . "2020-09-25T23:59:00Z")) (MergedFreeBusyIntervalInMinutes . 60)