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

feat: make it possible to choose time display format in player #270

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

justusmattern27
Copy link
Member

No description provided.

Copy link
Member

@hkonsti hkonsti left a comment

Choose a reason for hiding this comment

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

nice. left some minor comments :)

.toString()
.padStart(3, '0');

console.log('timedisplayformat', timeDisplayFormat);
Copy link
Member

Choose a reason for hiding this comment

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

left over console log

Copy link
Member Author

Choose a reason for hiding this comment

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

right

return `${toFormattedTime(timeInSeconds)} / ${toFormattedTime(
absoluteTimeInSeconds,
)}`;
return `${toFormattedTime(timeInSeconds)} / ${toFormattedTime(absoluteTimeInSeconds)}`;
Copy link
Member

Choose a reason for hiding this comment

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

This seems to recursively call itself. Is this code even reachable? If not, you can either just return 'MM:SS' as the default case, or throw an "Unreachable" error. I think I'd prefer moving the MM:SS case down and removing that if condition so it becomes the default return.

Copy link
Member Author

Choose a reason for hiding this comment

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

no, the toFormattedTime function is defined inside of getFormattedTime. The last return statement always applies. You had built it that way initially so I just kept it :D

@justusmattern27 justusmattern27 merged commit 7381c9d into main Sep 10, 2024
9 checks passed
@justusmattern27 justusmattern27 deleted the justus/player-milliseconds branch September 10, 2024 13:19
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