Skip to content

Commit

Permalink
Merge pull request #41 from Extazx2/master
Browse files Browse the repository at this point in the history
Add calendar dates to the plugin
  • Loading branch information
timetheoretical authored Nov 21, 2020
2 parents 9b0df9c + 05c85da commit d646b2c
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit d646b2c

Please sign in to comment.