Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add support for time-zone attribute#316

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
davhdavh wants to merge5 commits intogithub:main
base:main
Choose a base branch
Loading
fromdavhdavh:main

Conversation

davhdavh
Copy link

fixes#292

@CopilotCopilotAI review requested due to automatic review settingsJune 20, 2025 12:59
@davhdavhdavhdavh requested a review froma team as acode ownerJune 20, 2025 12:59
Copilot

This comment was marked as outdated.

@davhdavhdavhdavh requested a review fromCopilotJune 24, 2025 02:20
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

Adds support for atime-zone attribute to the<relative-time> element, allowing consumers to specify IANA time zones for formatting. Key changes:

  • Introduced tests covering setting, changing, and inheritingtime-zone.
  • Implemented atimeZone getter, observed attribute, and integrated intoIntl.DateTimeFormat options.
  • Updated README with documentation for the newtime-zone attribute.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
test/relative-time.jsNew test suite fortime-zone behavior (setting, updating, inheriting)
src/relative-time-element.tsAddedtimeZone getter, included'time-zone' inobservedAttributes, and passedtimeZone to formatters
README.mdAdded documentation entry for thetime-zone attribute
Comments suppressed due to low confidence (2)

test/relative-time.js:2590

  • [nitpick] The suite name uses camelCase[timeZone], but the attribute is hyphenatedtime-zone. Rename to[time-zone] for consistency with attribute naming.
  suite('[timeZone]', function () {

test/relative-time.js:2630

  • Relying on the system default time zone makes this assertion environment-dependent and potentially flaky. Consider mocking the default time zone or explicitly setting a fallback for consistent test results.
      assert.equal(el.shadowRoot.textContent, 'Wed, Jan 1, 2020, 4:00:00 PM')

</relative-time>
```

If the individual element does not have a `time-zone` attribute then it will traverse upwards in the tree to find the closest element that does, or default the `time-zone` to the browsers default.
Copy link
Preview

CopilotAIJun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Grammar: change “browsers default” to “browser's default” to fix the possessive form.

Suggested change
If the individual element does not have a`time-zone` attribute then it will traverse upwards in the tree to find the closest element that does, or default the`time-zone` to thebrowsers default.
If the individual element does not have a`time-zone` attribute then it will traverse upwards in the tree to find the closest element that does, or default the`time-zone` to thebrowser's default.

Copilot uses AI. Check for mistakes.

@TylerJDev
Copy link
Contributor

Hey@davhdavh! 👋

Thanks so much for the PR! We'll aim to take a look at it and review it this week! 😁

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@TylerJDevTylerJDevTylerJDev approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Allow setting timezone attribute
2 participants
@davhdavh@TylerJDev

[8]ページ先頭

©2009-2025 Movatter.jp