Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explorer: Consistent Display of Relative Time on Desktop and Mobile #1798

Merged
merged 1 commit into from
May 27, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ exports[`Blocks List > renders the Blocks List component 1`] = `
class="dusk-icon dusk-icon--size--normal detail-list__help"
data-tooltip-id="main-tooltip"
data-tooltip-place="top"
data-tooltip-text="The date and time the block was created"
data-tooltip-text="Time elapsed since the block was created"
data-tooltip-type="info"
role="graphics-symbol"
viewBox="0 0 24 24"
Expand All @@ -60,7 +60,7 @@ exports[`Blocks List > renders the Blocks List component 1`] = `
<!--&lt;Icon&gt;-->
timestamp
relative time
</dt>
<dd
Expand All @@ -71,7 +71,7 @@ exports[`Blocks List > renders the Blocks List component 1`] = `
datetime="2024-04-16T20:07:02.000Z"
slot="definition"
>
Tue, 16 Apr 2024 20:07:02 GMT (last month)
last month
</time>
</dd>
<!--&lt;ListItem&gt;-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ exports[`Transactions List > renders the Transactions List component 1`] = `
class="dusk-icon dusk-icon--size--normal detail-list__help"
data-tooltip-id="main-tooltip"
data-tooltip-place="top"
data-tooltip-text="The date and time the transaction was created"
data-tooltip-text="Time elapsed since the transaction was created"
data-tooltip-type="info"
role="graphics-symbol"
viewBox="0 0 24 24"
Expand All @@ -60,7 +60,7 @@ exports[`Transactions List > renders the Transactions List component 1`] = `
<!--&lt;Icon&gt;-->
timestamp
relative time
</dt>
<dd
Expand All @@ -71,7 +71,7 @@ exports[`Transactions List > renders the Transactions List component 1`] = `
datetime="2024-04-16T06:39:09.000Z"
slot="definition"
>
Tue, 16 Apr 2024 06:39:09 GMT (last month)
last month
</time>
</dd>
<!--&lt;ListItem&gt;-->
Expand Down
6 changes: 3 additions & 3 deletions explorer/src/lib/components/blocks-list/BlocksList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
</ListItem>

<!-- TIMESTAMP -->
<ListItem tooltipText="The date and time the block was created">
<svelte:fragment slot="term">timestamp</svelte:fragment>
<ListItem tooltipText="Time elapsed since the block was created">
<svelte:fragment slot="term">relative time</svelte:fragment>
<time
datetime={data.header.date.toISOString()}
class="block-details__list-timestamp"
slot="definition"
>
{`${data.header.date.toUTCString()} (${getRelativeTimeString(data.header.date, "long")})`}
{getRelativeTimeString(data.header.date, "long")}
</time>
</ListItem>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@
</ListItem>

<!-- TIMESTAMP -->
<ListItem tooltipText="The date and time the transaction was created">
<svelte:fragment slot="term">timestamp</svelte:fragment>
<ListItem tooltipText="Time elapsed since the transaction was created">
<svelte:fragment slot="term">relative time</svelte:fragment>
<time
datetime={data.date.toISOString()}
class="transaction-details__list-timestamp"
slot="definition"
>
{`${data.date.toUTCString()} (${getRelativeTimeString(data.date, "long")})`}
{getRelativeTimeString(data.date, "long")}
</time>
</ListItem>

Expand Down
Loading