use time element in output

This commit is contained in:
Cory LaViska
2022-03-16 17:40:08 -04:00
parent 485347e20b
commit fc4b1464b9

View File

@@ -1,4 +1,4 @@
import { LitElement } from 'lit';
import { html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { LocalizeController } from '~/utilities/localize';
@@ -58,19 +58,23 @@ export default class SlFormatDate extends LitElement {
return undefined;
}
return 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
});
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>
`;
}
}