-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix date rendering by adding <gitea-absolute-date>
#29725
Conversation
This is using the current naming scheme, not the one from #29400. Likely in that PR or separately, I will do the rename. |
@@ -0,0 +1,40 @@ | |||
window.customElements.define('gitea-locale-date', class extends HTMLElement { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not extend <relative-time>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We aren't replacing https://github.com/github/relative-time-element, we are just adding another custom element to render absolute dates in locale format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and to answer specifically: <relative-time>
is not meant to be passed dates, only datetimes. So it's currently unsuitable for the date rendering and I'm not sure whether upstream would accept a date
parameter as it would increase internal complexity of the component a lot.
Backport? |
We can try.... |
Yeah, would be good. |
I'm open to renaming as well. |
<gitea-locale-date>
<gitea-absolute-date>
Let's see if it backports automatically 😆. |
Alternative to: go-gitea#29698 Fixes: go-gitea#29034 <img width="278" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/12ecd967-2723-410d-8a28-a1b0f41b7bba"> It also fixes a secondary issue that we were showing timestamp tooltips over date, which makes no sense, so these are now gone as well: <img width="284" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/a70432f3-97b6-41e6-b202-b53b76924a66">
Backport #29725 by @silverwind Alternative to: #29698 Fixes: #29034 <img width="278" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/12ecd967-2723-410d-8a28-a1b0f41b7bba"> It also fixes a secondary issue that we were showing timestamp tooltips over date, which makes no sense, so these are now gone as well: <img width="284" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/a70432f3-97b6-41e6-b202-b53b76924a66"> Co-authored-by: silverwind <[email protected]>
* giteaofficial/main: Fix date rendering by adding `<gitea-absolute-date>` (go-gitea#29725) Update to labeler v5 (go-gitea#29721) Update Chroma to v2.13.0 (go-gitea#29732) Highlight archived labels (go-gitea#29680)
Hmm, will need to debug this. You sure your branch is up to date? |
* main: fix missed RenderLabel change in card template (go-gitea#29772) Fix incorrect locale Tr for gpg command (go-gitea#29754) Improve a11y document and dropdown item (go-gitea#29753) Improve QueryEscape helper function (go-gitea#29768) Use relative links for commits, mentions, and issues in markdown (go-gitea#29427) Move fork router functions to a standalone file (go-gitea#29756) Configure pinned JS dependencies via updates.config.js (go-gitea#29696) Refactor to use optional.Option for issue index search option (go-gitea#29739) Fix user router possbile panic (go-gitea#29751) Refactor label.IsArchived() (go-gitea#29750) Fix date rendering by adding `<gitea-absolute-date>` (go-gitea#29725) Update to labeler v5 (go-gitea#29721) Update Chroma to v2.13.0 (go-gitea#29732)
@yardenshoham try #29804. Note, I'm not convinced the old implementation had bugs but this new one surely won't. |
Alternative to: #29698
Fixes: #29034
It also fixes a secondary issue that we were showing timestamp tooltips over date, which makes no sense, so these are now gone as well: