Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
Better formatting for exposure time; fixes #229
Browse files Browse the repository at this point in the history
  • Loading branch information
GuLinux committed Jun 4, 2020
1 parent 363e6e2 commit 7ce268c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ export const isDevelopmentMode = process.env.NODE_ENV === 'development';

export const sanitizePath = (name) => name.replace('/', '-');

export const secs2time = seconds => {
var date = new Date(null);
date.setSeconds(seconds); // specify value for SECONDS here
return date.toISOString().substr(11, 8);
export const secs2time = (seconds, format='%02d:%02d:%06.3f') => {
let secs = seconds % 60;
let remainder = seconds / 60;
let minutes = remainder % 60;
remainder/= 60;
return sprintf(format, remainder, minutes, secs);
}


Expand Down

0 comments on commit 7ce268c

Please sign in to comment.