Show the docs update time as relative, exact stamp on hover - #5474
Open
dimitrieh wants to merge 3 commits into
Open
Show the docs update time as relative, exact stamp on hover#5474dimitrieh wants to merge 3 commits into
dimitrieh wants to merge 3 commits into
Conversation
"Updated: 2026-03-18 15:07:47 +0000" asks the reader to work out how stale a page is. "Updated: 5 months ago" answers it. The exact stamp stays available in the title attribute and in datetime, so nothing is lost. Docs pages are prerendered, so the relative label is set on mount rather than at build time, where it would freeze until the next build. The server still renders the exact stamp, which is what a reader without JS keeps and what makes hydration quiet.
app.vue renders <NuxtPage /> with no key and the docs page sets no page key, so every /docs page shares one component instance. Navigating between them patches the value prop instead of remounting, and onMounted does not fire again, so an assigned ref kept showing the previous page's label. A computed tracks the prop.
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ZJvandeWeg
requested changes
Aug 3, 2026
Member
There was a problem hiding this comment.
Are these executed? I vote to not test it actually
| @@ -0,0 +1,54 @@ | |||
| // Formats the docs `updated:` stamp. Kept free of Nuxt and Vue imports so it can be | |||
Member
There was a problem hiding this comment.
I bet there's a library to do all this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
The docs sidebar prints
Updated: 2026-03-18 15:07:47 +0000. This showsUpdated: 5 months ago, with the exact stamp on hover:The label is worked out in the browser, since a prerendered page would freeze it until the next build. The server still renders the exact stamp, so it survives without JS.
Formatting lives in
nuxt/lib/relative-time.mjswith 7 unit tests. Pairs with #5473, which gives each page its own date, but does not depend on it.Related Issue(s)
Checklist