WebUI Improvements and fixes (#9613)

* Show toast instead of text for success and errors

* Show correct times

* Start playing next hour when current hour ends

* Fix refreshing camera image

* Fix timeline
This commit is contained in:
Nicolas Mowen
2024-02-05 16:54:08 -07:00
committed by GitHub
parent 3df8b5829c
commit f4310862aa
10 changed files with 435 additions and 57 deletions

View File

@@ -284,8 +284,13 @@ export function getRangeForTimestamp(timestamp: number) {
date.setHours(date.getHours() + 1);
// ensure not to go past current time
const end = Math.min(new Date().getTime() / 1000, date.getTime() / 1000);
return { start, end };
return { start, end: endOfHourOrCurrentTime(date.getTime() / 1000) };
}
export function endOfHourOrCurrentTime(timestamp: number) {
const now = new Date();
now.setMilliseconds(0);
return Math.min(timestamp, now.getTime() / 1000);
}
export function isCurrentHour(timestamp: number) {