diff --git a/.changeset/itchy-ravens-shout.md b/.changeset/itchy-ravens-shout.md new file mode 100644 index 00000000000..eb689bd2e38 --- /dev/null +++ b/.changeset/itchy-ravens-shout.md @@ -0,0 +1,5 @@ +--- +"@hashicorp/design-system-components": patch +--- + +`Time` - fixed type error where the TooltipButton text could be undefined. diff --git a/packages/components/src/components/hds/time/index.hbs b/packages/components/src/components/hds/time/index.hbs index 24785c59ec6..03a3f623643 100644 --- a/packages/components/src/components/hds/time/index.hbs +++ b/packages/components/src/components/hds/time/index.hbs @@ -8,7 +8,6 @@ {{~#if this.hasTooltip~}} { 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 {