Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add calendar dates to the plugin #41

Merged
merged 1 commit into from
Nov 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions JitsiMeetOutlook/NewJitsiAppointment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public NewJitsiAppointment()
// Get the Application object
Outlook.Application application = Globals.ThisAddIn.Application;

DateTime dateNull = new DateTime(4501, 1, 1, 0, 0, 0);
Outlook.Explorer expl = application.ActiveExplorer();
Outlook.View view = expl.CurrentView as Outlook.View;

try
{
// Generate meeting ID
Expand All @@ -28,6 +32,18 @@ public NewJitsiAppointment()
newAppointment.Location = "Jitsi Meet";
newAppointment.Body = generateBody(jitsiRoomId);

if (view.ViewType == Outlook.OlViewType.olCalendarView)
{
Outlook.CalendarView calView = view as Outlook.CalendarView;
DateTime dateStart = calView.SelectedStartTime;
DateTime dateEnd = calView.SelectedEndTime;
if (dateStart != dateNull && dateEnd != dateNull)
{
newAppointment.Start = dateStart;
newAppointment.End = dateEnd;
}
}

// Display ribbon group, then the appointment window
Globals.ThisAddIn.ShowRibbonAppointment = true;
newAppointment.Display(false);
Expand Down