Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/itchy-ravens-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hashicorp/design-system-components": patch
---

`Time` - fixed type error where the TooltipButton text could be undefined.
1 change: 0 additions & 1 deletion packages/components/src/components/hds/time/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{{~#if this.hasTooltip~}}
<Hds::TooltipButton
class="hds-time-wrapper"
{{! @glint-expect-error: FIXME: pnpm migration }}
@text={{if
display.options.tooltipFormat
(hds-format-date this.date display.options.tooltipFormat)
Expand Down
8 changes: 5 additions & 3 deletions packages/components/src/components/hds/time/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ export default class HdsTime extends Component<HdsTimeSignature> {
return this.args.hasTooltip ?? true;
}

get isoUtcString(): string | undefined {
get isoUtcString(): string {
const date = this.date;

if (dateIsValid(date)) {
return this.hdsTime.toIsoUtcString(date);
const isoUtcString = this.hdsTime.toIsoUtcString(date);

if (isoUtcString) return isoUtcString;
}

return undefined;
return '';
}

get rangeIsoUtcString(): string {
Expand Down