Skip to content
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

Gracefully handle when playback time might be a invalid date value #126

Merged
merged 4 commits into from
Nov 28, 2023

Conversation

MikeShi42
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Nov 28, 2023

🦋 Changeset detected

Latest commit: eeb4985

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

@jaggederest jaggederest left a comment

Choose a reason for hiding this comment

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

👍 Will leave proper approval to someone with more than 5 days on the job :)

@@ -28,7 +28,12 @@ function formatTs({
const seconds = Math.floor((value / 1000) % 60);
return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
} else {
return format(new Date(ts), 'hh:mm:ss a');
try {
return format(new Date(ts), 'hh:mm:ss a');
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we can also use isValid (https://date-fns.org/v2.16.1/docs/isValid) to verify date object

@MikeShi42 MikeShi42 merged commit 7784921 into main Nov 28, 2023
3 checks passed
@MikeShi42 MikeShi42 deleted the mikeshi/fix-invalid-ts-format-error branch November 28, 2023 08:09
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.

None yet

3 participants