Fix tiny timing bug. (#2994)

This commit is contained in:
Dermot Duffy 2022-03-21 04:43:27 -07:00 committed by GitHub
parent b1cc64d4fa
commit c424c4b7ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,7 @@ export function EventCard({ camera, event, delay }) {
const end = fromUnixTime(event.end_time);
const hours = differenceInHours(end, start);
const minutes = differenceInMinutes(end, start) - hours * 60;
const seconds = differenceInSeconds(end, start) - hours * 60 - minutes * 60;
const seconds = differenceInSeconds(end, start) - hours * 60 * 60 - minutes * 60;
duration = '';
if (hours) duration += `${hours}h `;
if (minutes) duration += `${minutes}m `;