Fix default upload duration being shown in raw seconds#3470
Fix default upload duration being shown in raw seconds#3470rtibbles merged 3 commits intolearningequality:unstablefrom
Conversation
|
@rtibbles the above mentioned issue on PR description is fixed. Btw, there's a bug that I observed while I was fixing this issue. On uploading a new file when there's a already uploaded file, the If we can make ActivityDuration react whenever a new file is uploaded we can fix it I think? |
|
Ah, that's a good catch - can you file a follow up issue for that case? |
| }, | ||
| convertToHHMMSS(totalSeconds) { | ||
| if (totalSeconds !== null && Number.isInteger(totalSeconds)) { | ||
| const hours = Math.floor(totalSeconds / 3600) |
There was a problem hiding this comment.
This method will give the same result and seems a little simpler: https://stackoverflow.com/a/25279399
There was a problem hiding this comment.
That implementation breaks when input seconds are greater than or equal to 86400 seconds.
On 86400 seconds, it outputs 00:00:00. The expected output should be 24:00:00. Date objects are relative to specific parameters like timezone, etc. And our use case is absolute in nature. So, IMO the current implementation feels more robust to me.
|
An issue for the outdated completion criteria duration: #3472. |
rtibbles
left a comment
There was a problem hiding this comment.
Looks like it does the trick!
Summary
This PR fixes the default upload duration being shown in raw seconds. Now, we show the
durationinHH:MM:SSformat.Screenshots (if applicable)
Before:

After:

Reviewer guidance
References
Closes #3465.
Contributor's Checklist
PR process:
CHANGELOGlabel been added to this PR. Note: items with this label will be added to the CHANGELOG at a later timedocslabel has been added if this introduces a change that needs to be updated in the user docs?requirements.txtfiles also included in this PRStudio-specifc:
notranslateclass been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)pages,components, andlayoutsdirectories as described in the docsTesting:
Reviewer's Checklist
This section is for reviewers to fill out.
yarnandpip)