Skip to content

use html <time> element#154

Draft
ximex wants to merge 1 commit intomatter-js:mainfrom
ximex:html-time-element
Draft

use html <time> element#154
ximex wants to merge 1 commit intomatter-js:mainfrom
ximex:html-time-element

Conversation

@ximex
Copy link
Contributor

@ximex ximex commented Jan 29, 2026

a bit of semantic

Copilot AI review requested due to automatic review settings January 29, 2026 17:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds semantic HTML <time> elements to display date/time information in the node details component, improving accessibility and machine readability of temporal data.

Changes:

  • Wraps date_commissioned and last_interview values with HTML <time> elements
  • Adds datetime attributes to provide machine-readable timestamps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<div slot="supporting-text"><span class="left">productName: </span>${this.node.productName}</div>
<div slot="supporting-text">
<span class="left">Commissioned: </span>${this.node.date_commissioned}
<span class="left">Commissioned: </span><time datetime=${this.node.date_commissioned}>${this.node.date_commissioned}</time>
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The datetime attribute value lacks timezone information. According to HTML5 specifications, datetime attributes should include timezone information for global date and time strings. Consider appending 'Z' to indicate UTC time (e.g., ${this.node.date_commissioned}Z) or using a local date-time format if the times are intended to be timezone-independent. Without timezone information, browsers and assistive technologies may interpret the time inconsistently.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it required that we convert the Date object to a formatted string in ws-controller already or could we move the formatting into node-details?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this in the response would break the websocket definions, right?
Maybe lets open a "cpllection ticket" for such updates because we plan an updated websocket format anyway soon. Then we can do this

</div>
<div slot="supporting-text">
<span class="left">Last interviewed: </span>${this.node.last_interview}
<span class="left">Last interviewed: </span><time datetime=${this.node.last_interview}>${this.node.last_interview}</time>
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The datetime attribute value lacks timezone information. According to HTML5 specifications, datetime attributes should include timezone information for global date and time strings. Consider appending 'Z' to indicate UTC time (e.g., ${this.node.last_interview}Z) or using a local date-time format if the times are intended to be timezone-independent. Without timezone information, browsers and assistive technologies may interpret the time inconsistently.

Copilot uses AI. Check for mistakes.
@ximex ximex force-pushed the html-time-element branch from 311ae31 to b8f7ec9 Compare January 29, 2026 17:04
@ximex ximex marked this pull request as draft January 29, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants