format duration in minutes (seconds)

This commit is contained in:
Julien Calixte
2023-04-10 21:29:52 +02:00
parent da2ff740d2
commit 9b518ca851
4 changed files with 24 additions and 16 deletions

View File

@@ -1,3 +1,4 @@
import { formatDiffInMinutes } from '@/shared/format-date'
import { toISODate, type ISODate } from '@/shared/types/date'
import type { Recordable } from '../interfaces/recordable'
import type { StepRecordable } from '../interfaces/step-recordable'
@@ -17,10 +18,7 @@ export class TaskRecord implements Recordable {
return null
}
const durationMilliseconds =
new Date(this.end).getTime() - new Date(this.start).getTime()
return Math.round(durationMilliseconds / (1000 * 60))
return formatDiffInMinutes(this.start, this.end)
}
public get hasStepRecords() {