Skip to content

Fix/timeline playhead utc alignment#1415

Closed
dmcalester wants to merge 4 commits intomainfrom
fix/timeline-playhead-utc-alignment
Closed

Fix/timeline playhead utc alignment#1415
dmcalester wants to merge 4 commits intomainfrom
fix/timeline-playhead-utc-alignment

Conversation

@dmcalester
Copy link
Copy Markdown
Contributor

Brief Description

JIRA Link

Related Issue

General Notes

Motivation and Context

Issues and Limitations

Types of changes

  • Bug fix
  • New feature
  • Breaking change

Checklist

  • This PR adds or removes a Storybook story.
  • I have added tests to cover my changes.
  • Regressions are passing and/or failures are documented
  • Changes have been checked in evergreen browsers

Duncan McAlester and others added 2 commits July 23, 2025 15:13
This commit addresses issue #1413 where the playhead was misaligned by approximately 1 hour when using UTC timezone.

Changes:
- Modified _calculatePlayheadFromTime() method to handle timezone-aware date calculations
- Added UTC-specific date handling to ensure consistent positioning
- Imported utcToZonedTime from date-fns-tz for proper timezone conversion
- Added comprehensive Playwright tests for playhead positioning with different timezones

The fix ensures that when timezone="UTC" is specified, both the timeline start and playhead times are processed consistently to avoid timezone offset issues.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 23, 2025

⚠️ No Changeset found

Latest commit: 1817a20

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Jul 23, 2025

Deploy Preview for astro-stencil ready!

Name Link
🔨 Latest commit 1817a20
🔍 Latest deploy log https://app.netlify.com/projects/astro-stencil/deploys/688247cf0c0a8f0008f22869
😎 Deploy Preview https://deploy-preview-1415--astro-stencil.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Jul 23, 2025

Deploy Preview for astro-preview ready!

Name Link
🔨 Latest commit 1817a20
🔍 Latest deploy log https://app.netlify.com/projects/astro-preview/deploys/688247cf8cf9790008189d57
😎 Deploy Preview https://deploy-preview-1415--astro-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dmcalester dmcalester requested a review from Copilot July 24, 2025 14:17
Copy link
Copy Markdown

Copilot AI 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

This PR fixes timezone alignment issues for the timeline playhead component, ensuring consistent positioning across different timezone configurations. The changes address a bug where the playhead position calculation was inconsistent when using UTC timezone versus other timezones.

  • Updated playhead position calculation logic to handle UTC and non-UTC timezones consistently
  • Added comprehensive test coverage for timezone-specific playhead positioning scenarios

Reviewed Changes

Copilot reviewed 2 out of 9 changed files in this pull request and generated 2 comments.

File Description
packages/web-components/src/components/rux-timeline/rux-timeline.tsx Updated playhead calculation logic to properly handle UTC and timezone conversions using date-fns-tz
packages/web-components/src/components/rux-timeline/test/timeline.spec.ts Added test suite for timezone handling with UTC and America/New_York timezone scenarios
Files not reviewed (7)
  • packages/angular-workspace/package-lock.json: Language not supported
  • packages/angular-workspace/projects/angular/package-lock.json: Language not supported
  • packages/framework-testing/astro-angular/package-lock.json: Language not supported
  • packages/framework-testing/astro-react/package-lock.json: Language not supported
  • packages/framework-testing/astro-vue/package-lock.json: Language not supported
  • packages/react/package-lock.json: Language not supported
  • packages/web-components/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

packages/web-components/src/components/rux-timeline/test/timeline.spec.ts:618

  • The test comment suggests both playheads should be at the same position, but there's no assertion to verify this behavior. Consider adding assertions to compare the relative positions of UTC and EST playheads.
        // Both should be positioned at the same relative location since we're using the same UTC times

Duncan McAlester and others added 2 commits July 24, 2025 07:27
Address code review feedback by replacing redundant Date object creation
with explicit UTC time calculations for better timezone normalization.

Changes:
- Remove redundant new Date(date.getTime()) operations that provided no timezone benefit
- Use explicit millisecond-based calculations for UTC timezone case
- Maintain timezone-aware date-fns functions for non-UTC timezones
- Consolidate interval-specific logic for cleaner code structure
- Fix month interval calculation to properly handle both UTC and non-UTC cases

This provides a more explicit and reliable approach to UTC handling
while maintaining backward compatibility with existing timezone functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dmcalester dmcalester closed this Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants