diff --git a/src/Components/Workspace/index.js b/src/Components/Workspace/index.js index d01db3bc..9fd32827 100644 --- a/src/Components/Workspace/index.js +++ b/src/Components/Workspace/index.js @@ -22,6 +22,7 @@ import { formReducer, incrementCopyName, initialFormState, } from '../../Util/fo import { createCollectionItem, createOrUpdateCollectionItem, deleteCollectionItem, handleDeleteItem, handleDuplicateItem, updateCollectionItem, updateItems } from '../../Util/collection'; +import { formatDuration } from '../../Util/time'; const WorkspaceView = props => { const UPLOADFOLDER = 'uploads'; @@ -284,17 +285,6 @@ const WorkspaceView = props => { // general - const formatDuration = async (duration) => { - const seconds = Number(duration); - const m = Math.floor((seconds % 3600) / 60); - const s = Math.floor(seconds % 60); - - const mDisplay = m > 0 ? m + (m === 1 ? ' min ' : ' mins ') : ''; - const sDisplay = s > 0 ? s + (s === 1 ? ' s' : ' s') : ''; - - return mDisplay + sDisplay; - }; - const finishCreateOrUpdateTranscript = async (transcript, duration, video) => { video.remove(); const file = transcript.file; diff --git a/src/Util/time/index.js b/src/Util/time/index.js index ef7901e9..0bfb6354 100644 --- a/src/Util/time/index.js +++ b/src/Util/time/index.js @@ -55,4 +55,15 @@ const formatDates = (item) => { }; -export { ToHumanReadable, ToDhmsCompact, getISOTime, updateDescOrder, formatDates }; +const formatDuration = async (duration) => { + const seconds = Number(duration); + const m = Math.floor((seconds % 3600) / 60); + const s = Math.floor(seconds % 60); + + const mDisplay = m > 0 ? m + (m === 1 ? ' min ' : ' mins ') : ''; + const sDisplay = s > 0 ? s + (s === 1 ? ' s' : ' s') : ''; + + return mDisplay + sDisplay; +}; + +export { ToHumanReadable, ToDhmsCompact, getISOTime, updateDescOrder, formatDates, formatDuration };