-
Notifications
You must be signed in to change notification settings - Fork 835
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
Fix time label when time is more than an hour #900
Conversation
Why are we showing milliseconds there? Seems unnecessary. |
renderer/utils/format-time.js
Outdated
}; | ||
|
||
const format = (time, {showMilliseconds} = {}) => { | ||
const formatString = `${time >= 60 * 60 ? 'h:m' : ''}m:ss${showMilliseconds ? '.SS' : ''}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but I think we should show it as
const formatString = `${time >= 60 * 60 ? 'h:m' : ''}m:ss${showMilliseconds ? '.SS' : ''}`; | |
const formatString = `${time >= 60 * 60 ? 'hh:mm' : ''}mm:ss${showMilliseconds ? '.SS' : ''}`; |
This is how most video players show duration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant this:
const formatString = `${time >= 60 * 60 ? 'h:m' : ''}m:ss${showMilliseconds ? '.SS' : ''}`; | |
const formatString = `${time >= 60 * 60 ? 'h:' : ''}mm:ss${showMilliseconds ? '.SS' : ''}`; |
right? Otherwise if it's more than an hour the format becomes hh:mmmm:ss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant:
const formatString = `${time >= 60 * 60 ? 'h:m' : ''}m:ss${showMilliseconds ? '.SS' : ''}`; | |
const formatString = `${time >= 60 * 60 ? 'hh:m' : ''}m:ss${showMilliseconds ? '.SS' : ''}`; |
I'm not sure about the milliseconds. I've never found it useful, but it was like that since Kap 2.x, so I just kept the logic during the rewrite. I'm ok with removing them. |
Yeah, let's try removing it and see if anyone complains. |
Removed milliseconds and changed the format 👍 |
Fixes #893