Allow passing dateStyle and timeStyle to Intl.DateTimeFormat#319
Draft
Wigny wants to merge 1 commit intogithub:mainfrom
Draft
Allow passing dateStyle and timeStyle to Intl.DateTimeFormat#319Wigny wants to merge 1 commit intogithub:mainfrom
dateStyle and timeStyle to Intl.DateTimeFormat#319Wigny wants to merge 1 commit intogithub:mainfrom
Conversation
Wigny
commented
Aug 25, 2025
Comment on lines
+201
to
+202
| dateStyle: this.dateStyle, | ||
| timeStyle: this.timeStyle, |
Author
There was a problem hiding this comment.
I've added these properties, but I'm not entirely sure on where to put the tests for them. Should they be in the 'table tests' suite or somewhere else?
IDisposable
reviewed
Dec 12, 2025
src/relative-time-element.ts
Outdated
| } | ||
|
|
||
| set timeStyle(value: 'short' | 'long' | 'full' | 'medium' | undefined) { | ||
| this.setAttribute('time-style', value ?? '') |
There was a problem hiding this comment.
This will cause a call of timeStyle = undefined to actually result in the time-style attribute being defined, and a empty/blank string. That seems incorrect.
Author
There was a problem hiding this comment.
Updated it to only set the property if value is truthy, or unset it otherwise.
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.
Solves #260.