-
Notifications
You must be signed in to change notification settings - Fork 187
Experimental: Check for override attribute disable-preference-override
#331
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -244,6 +244,9 @@ export class RelativeTimeElement extends HTMLElement implements Intl.DateTimeFor | |
| // Never override duration format with absolute format. | ||
| if (format === 'duration') return false | ||
|
|
||
| // Override for user preferences; used sparingly to preserve intended relative formatting in some places | ||
| if (this.hasAttribute('ignore-user-time-preference')) return false | ||
|
||
|
|
||
| return ( | ||
| this.ownerDocument.documentElement.getAttribute('data-prefers-absolute-time') === 'true' || | ||
| this.ownerDocument.body?.getAttribute('data-prefers-absolute-time') === 'true' | ||
|
|
||
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.
The new
ignore-user-time-preferenceattribute is not documented in the README.md. The attributes table (lines 65-84) and attribute descriptions should include this new attribute, explaining its purpose to override the globaldata-prefers-absolute-timesetting for specific elements. The inline comment on line 247 suggests this is intentional functionality that should be part of the public API documentation.