remove whitespace; closes #1417 (#1418)

This commit is contained in:
Cory LaViska
2025-09-10 10:38:06 -04:00
committed by GitHub
parent 4993b1034f
commit 4ac31e06f3
3 changed files with 19 additions and 18 deletions

View File

@@ -36,6 +36,7 @@ Components with the <wa-badge variant="warning">Experimental</wa-badge> badge sh
- Fixed a bug in `<wa-input>` that prevented the value from changing when assigning non-string values to `value` [issue:1323]
- Fixed a bug in `<wa-color-picker>` that prevent the picker from staying in the viewport
- Fixed a bug that in `<wa-icon>` that caused `library`, `family`, `variant` and `name` to not reflect [pr:#1395]
- Fixed a bug in `<wa-format-date>` and `<wa-relative-time>` that caused spaces to appear before and after the output [#1417]
## 3.0.0-beta.4

View File

@@ -66,23 +66,22 @@ export default class WaFormatDate extends WebAwesomeElement {
return undefined;
}
return html`
<time datetime=${date.toISOString()}>
${this.localize.date(date, {
weekday: this.weekday,
era: this.era,
year: this.year,
month: this.month,
day: this.day,
hour: this.hour,
minute: this.minute,
second: this.second,
timeZoneName: this.timeZoneName,
timeZone: this.timeZone,
hour12: hour12,
})}
</time>
`;
const displayDate = this.localize.date(date, {
weekday: this.weekday,
era: this.era,
year: this.year,
month: this.month,
day: this.day,
hour: this.hour,
minute: this.minute,
second: this.second,
timeZoneName: this.timeZoneName,
timeZone: this.timeZone,
hour12: hour12,
});
// No whitespace before or after
return html`<time datetime=${date.toISOString()}>${displayDate}</time>`;
}
}

View File

@@ -99,7 +99,8 @@ export default class WaRelativeTime extends WebAwesomeElement {
this.updateTimeout = setTimeout(() => this.requestUpdate(), nextInterval);
}
return html` <time datetime=${this.isoTime}>${this.relativeTime}</time> `;
// No whitespace before or after
return html`<time datetime=${this.isoTime}>${this.relativeTime}</time>`;
}
}