DEV: Fix typos "formated" -> "formatted" (#17156)

(nothing in all-the* relies on these)
This commit is contained in:
Jarek Radosz
2022-06-20 20:02:05 +02:00
committed by GitHub
parent 95a6268c45
commit 36c2284dea
15 changed files with 98 additions and 96 deletions

View File

@ -207,7 +207,7 @@ export default Component.extend({
),
@computed("currentUserTimezone")
formatedCurrentUserTimezone(timezone) {
formattedCurrentUserTimezone(timezone) {
return timezone.replace("_", " ").replace("Etc/", "").replace("/", ", ");
},

View File

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

View File

@ -27,7 +27,7 @@ export function applyLocalDates(dates, siteSettings) {
<svg class="fa d-icon d-icon-globe-americas svg-icon" xmlns="http://www.w3.org/2000/svg">
<use href="#globe-americas"></use>
</svg>
<span class="relative-time">${localDateBuilder.formated}</span>
<span class="relative-time">${localDateBuilder.formatted}</span>
`
);
element.setAttribute("aria-label", localDateBuilder.textPreview);
@ -151,7 +151,7 @@ function buildHtmlPreview(element, siteSettings) {
const dateTimeNode = document.createElement("span");
dateTimeNode.classList.add("date-time");
dateTimeNode.innerHTML = preview.formated;
dateTimeNode.innerHTML = preview.formatted;
previewNode.appendChild(dateTimeNode);
return previewNode;

View File

@ -71,7 +71,7 @@ export default class LocalDateBuilder {
pastEvent:
!this.recurring &&
moment.tz(this.localTimezone).isAfter(localDate.datetime),
formated: this._applyFormatting(localDate, displayedTimezone),
formatted: this._applyFormatting(localDate, displayedTimezone),
previews,
textPreview: this._generateTextPreviews(previews),
};
@ -80,8 +80,8 @@ export default class LocalDateBuilder {
_generateTextPreviews(previews) {
return previews
.map((preview) => {
const formatedZone = this._zoneWithoutPrefix(preview.timezone);
return `${formatedZone} ${preview.formated}`;
const formattedZone = this._zoneWithoutPrefix(preview.timezone);
return `${formattedZone} ${preview.formatted}`;
})
.join(", ");
}
@ -96,7 +96,7 @@ export default class LocalDateBuilder {
previewedTimezones.push({
timezone: this._zoneWithoutPrefix(this.localTimezone),
current: true,
formated: this._createDateTimeRange(
formatted: this._createDateTimeRange(
DateWithZoneHelper.fromDatetime(
localDate.datetime,
localDate.timezone,
@ -128,7 +128,7 @@ export default class LocalDateBuilder {
previewedTimezones.push({
timezone: this._zoneWithoutPrefix(timezone),
formated: this._createDateTimeRange(
formatted: this._createDateTimeRange(
DateWithZoneHelper.fromDatetime(
localDate.datetime,
localDate.timezone,
@ -288,7 +288,9 @@ export default class LocalDateBuilder {
}
_formatWithZone(localDate, displayedTimezone, format) {
let formated = localDate.datetimeWithZone(displayedTimezone).format(format);
return `${formated} (${this._zoneWithoutPrefix(displayedTimezone)})`;
let formatted = localDate
.datetimeWithZone(displayedTimezone)
.format(format);
return `${formatted} (${this._zoneWithoutPrefix(displayedTimezone)})`;
}
}