FIX: ensures we can close event before it starts

FIX: ensures we can close event before it starts

diff --git a/assets/javascripts/discourse/widgets/discourse-post-event.js.es6 b/assets/javascripts/discourse/widgets/discourse-post-event.js.es6
index e60cc88..b99ea77 100644
--- a/assets/javascripts/discourse/widgets/discourse-post-event.js.es6
+++ b/assets/javascripts/discourse/widgets/discourse-post-event.js.es6
@@ -55,7 +55,7 @@ export default createWidget("discourse-post-event", {
     });
   },
 
-  closePostEvent(eventModel) {
+  closeEvent(eventModel) {
     bootbox.confirm(
       I18n.t("discourse_post_event.builder_modal.confirm_close"),
       I18n.t("no_value"),
@@ -64,9 +64,14 @@ export default createWidget("discourse-post-event", {
         if (confirmed) {
           return this.store.find("post", eventModel.id).then(post => {
             const raw = post.raw;
+            const startsAt = eventModel.starts_at
+              ? moment(eventModel.starts_at)
+              : moment();
             const eventParams = buildParams(
-              eventModel.starts_at ? moment(eventModel.starts_at) : moment(),
-              moment(),
+              moment().isBefore(startsAt) ? moment() : startsAt,
+              moment().isBefore(startsAt)
+                ? moment().add(1, "minute")
+                : moment(),
               eventModel
             );
             const newRaw = replaceRaw(eventParams, raw);
diff --git a/assets/javascripts/discourse/widgets/more-dropdown.js.es6 b/assets/javascripts/discourse/widgets/more-dropdown.js.es6
index 6771950..90c5d09 100644
--- a/assets/javascripts/discourse/widgets/more-dropdown.js.es6
+++ b/assets/javascripts/discourse/widgets/more-dropdown.js.es6
@@ -95,7 +95,7 @@ export default createWidget("more-dropdown", {
       if (!attrs.eventModel.is_expired) {
         content.push({
           icon: "times",
-          id: "closePostEvent",
+          id: "closeEvent",
           label: "discourse_post_event.event_ui.close_event",
           class: "danger",
           param: attrs.eventModel
diff --git a/assets/stylesheets/common/discourse-post-event.scss b/assets/stylesheets/common/discourse-post-event.scss
index 1d6fb9c..b861966 100644
--- a/assets/stylesheets/common/discourse-post-event.scss
+++ b/assets/stylesheets/common/discourse-post-event.scss
@@ -63,7 +63,7 @@
           }
         }
 
-        .item-closePostEvent {
+        .item-closeEvent {
           .d-icon,
           span {
             color: $danger;

GitHub sha: b359e9a2