UX: copy and formating improvements to local-dates form (#7343)

UX: copy and formating improvements to local-dates form (#7343)

diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 b/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6
index ade4551..3274b72 100644
--- a/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6
+++ b/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6
@@ -167,6 +167,14 @@ export default Ember.Component.extend({
     return moment.tz.guess();
   },
 
+  @computed("currentUserTimezone")
+  formatedCurrentUserTimezone(timezone) {
+    return timezone
+      .replace("_", " ")
+      .replace("Etc/", "")
+      .split("/");
+  },
+
   @computed("formats")
   previewedFormats(formats) {
     return formats.map(format => {
diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse/templates/components/discourse-local-dates-create-form.hbs b/plugins/discourse-local-dates/assets/javascripts/discourse/templates/components/discourse-local-dates-create-form.hbs
index 61f029f..3ed2875 100644
--- a/plugins/discourse-local-dates/assets/javascripts/discourse/templates/components/discourse-local-dates-create-form.hbs
+++ b/plugins/discourse-local-dates/assets/javascripts/discourse/templates/components/discourse-local-dates-create-form.hbs
@@ -1,5 +1,5 @@
 {{#d-modal-body
-  title="discourse_local_dates.create.modal_title"
+  title="discourse_local_dates.title"
   class="discourse-local-dates-create-modal"
   style="overflow: auto"}}
 
@@ -10,8 +10,7 @@
       </div>
     {{else}}
       <div class="preview alert alert-info">
-        <b>{{currentUserTimezone}}: </b>
-        {{currentPreview}}
+        <b>{{formatedCurrentUserTimezone}} </b>{{currentPreview}}
       </div>
     {{/unless}}
 
diff --git a/plugins/discourse-local-dates/config/locales/client.en.yml b/plugins/discourse-local-dates/config/locales/client.en.yml
index 5d5fa42..3152fdb 100644
--- a/plugins/discourse-local-dates/config/locales/client.en.yml
+++ b/plugins/discourse-local-dates/config/locales/client.en.yml
@@ -5,9 +5,8 @@ en:
         today: Today %{time}
         tomorrow: Tomorrow %{time}
         yesterday: Yesterday %{time}
-      title: Insert date
+      title: Insert date / time
       create:
-        modal_title: Insert date
         form:
           insert: Insert
           advanced_mode: Advanced mode

GitHub sha: ad5edc8b

1 Like