FIX: Regression in timezone name localizations (#15761)

This also switches to using the NPM package for better build stability. And adds a clearer label in the alert that is displayed to show your current timezone (when changing timezones).
This commit is contained in:
Penar Musaraj
2022-02-02 23:41:42 +01:00
committed by GitHub
parent c23ccd87f8
commit febe997bee
7 changed files with 32 additions and 22 deletions

View File

@ -205,7 +205,7 @@ export default Component.extend({
@computed("currentUserTimezone")
formatedCurrentUserTimezone(timezone) {
return timezone.replace("_", " ").replace("Etc/", "").split("/");
return timezone.replace("_", " ").replace("Etc/", "").replace("/", ", ");
},
@computed("formats")
@ -398,8 +398,10 @@ export default Component.extend({
return new Promise((resolve) => {
loadScript("/javascripts/pikaday.js").then(() => {
const options = {
field: this.$(`.fake-input`)[0],
container: this.$(`#picker-container-${this.elementId}`)[0],
field: this.element.querySelector(".fake-input"),
container: this.element.querySelector(
`#picker-container-${this.elementId}`
),
bound: false,
format: "YYYY-MM-DD",
reposition: false,

View File

@ -7,7 +7,8 @@
{{#if isValid}}
{{#if timezoneIsDifferentFromUserTimezone}}
<div class="preview alert alert-info">
<b>{{formatedCurrentUserTimezone}} </b>{{currentPreview}}
{{i18n "discourse_local_dates.create.form.current_timezone"}}
<b>{{formatedCurrentUserTimezone}}</b>{{currentPreview}}
</div>
{{/if}}
{{else}}