Skip to content

Commit

Permalink
Fixed formatProjectTime import
Browse files Browse the repository at this point in the history
  • Loading branch information
bananu7 committed Apr 2, 2024
1 parent 842e558 commit f289f49
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/components/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { Timeline } from './Timeline.tsx'

import { AudioSystem } from '../audio'
import { makeUrl, getJsonFile, getFile } from '../filebrowser'
import { floatToTimestring, formatProjectTime } from '../util'
import { floatToTimestring } from '../util'
import { formatProjectTime } from '../zoom/formatProjectTime'

import './Player.css'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Timeline.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CSSProperties, MouseEventHandler, PropsWithChildren } from 'react';
import { ProjectTimeSeconds } from '../zoom/zoom_l12';
import { formatProjectTime } from '../util';
import { formatProjectTime } from '../zoom/formatProjectTime'
import './Timeline.css'

export type TimelineProps = {
Expand Down
8 changes: 0 additions & 8 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,3 @@ export function floatToTimestring(f: number): string {

return `${hoursStr} : ${minutesStr} : ${secondsStr} : ${decStr}`
}

export function formatProjectTime(time: ProjectTimeSeconds) {
const hours = Math.floor(time / 3600);
time -= hours * 3600;
const minutes = Math.floor(time / 60);
time -= minutes * 60;
return `${hours}:${minutes}:${Math.floor(time)}`;
}
9 changes: 9 additions & 0 deletions src/zoom/formatProjectTime.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ProjectTimeSeconds } from './zoom_l12'

export function formatProjectTime(time: ProjectTimeSeconds) {
const hours = Math.floor(time / 3600);
time -= hours * 3600;
const minutes = Math.floor(time / 60);
time -= minutes * 60;
return `${hours}:${minutes}:${Math.floor(time)}`;
}

0 comments on commit f289f49

Please sign in to comment.