FEATURE: allows to hide add to calendar links

FEATURE: allows to hide add to calendar links

diff --git a/assets/javascripts/initializers/discourse-calendar.js.es6 b/assets/javascripts/initializers/discourse-calendar.js.es6
index 116fe3e..782ede8 100644
--- a/assets/javascripts/initializers/discourse-calendar.js.es6
+++ b/assets/javascripts/initializers/discourse-calendar.js.es6
@@ -169,6 +169,9 @@ function initializeDiscourseCalendar(api) {
         (isMobileView ? "listNextYear" : "month")
     );
 
+    const showAddToCalendar =
+      $calendar.attr("data-calendar-show-add-to-calendar") !== "false";
+
     return new window.FullCalendar.Calendar($calendar[0], {
       timeZone,
       timeZoneImpl: "moment-timezone",
@@ -196,8 +199,10 @@ function initializeDiscourseCalendar(api) {
         right: "month,basicWeek,listNextYear"
       },
       datesRender: info => {
-        _insertAddToCalendarLinks(info);
-        $calendarTitle.innerText = info.view.title;
+        if (showAddToCalendar) {
+          _insertAddToCalendarLinks(info);
+          $calendarTitle.innerText = info.view.title;
+        }
       }
     });
   }
diff --git a/assets/javascripts/lib/discourse-markdown/discourse-calendar.js.es6 b/assets/javascripts/lib/discourse-markdown/discourse-calendar.js.es6
index 57cff71..8a51fed 100644
--- a/assets/javascripts/lib/discourse-markdown/discourse-calendar.js.es6
+++ b/assets/javascripts/lib/discourse-markdown/discourse-calendar.js.es6
@@ -39,6 +39,13 @@ const calendarRule = {
       mainCalendarDivToken.attrs.push(["data-weekends", info.attrs.weekends]);
     }
 
+    if (info.attrs.showAddToCalendar) {
+      mainCalendarDivToken.attrs.push([
+        "data-calendar-show-add-to-calendar",
+        info.attrs.showAddToCalendar === "true"
+      ]);
+    }
+
     if (info.attrs.hiddenDays) {
       mainCalendarDivToken.attrs.push([
         "data-hidden-days",

GitHub sha: 90edefff