mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 17:55:21 +03:00
use hours instead of days
This commit is contained in:
parent
6ac0f3799a
commit
77a41eb2f3
@ -71,7 +71,7 @@ const TimePicker = ({ dateRange, onChange }) => {
|
||||
// function for handling the selected time from the provided list
|
||||
const handleTime = useCallback(
|
||||
(hour) => {
|
||||
if (!hour) return;
|
||||
if (isNaN(hour)) return;
|
||||
|
||||
const _timeRange = new Set([...timeRange]);
|
||||
_timeRange.add(hour);
|
||||
@ -96,8 +96,8 @@ const TimePicker = ({ dateRange, onChange }) => {
|
||||
//update after
|
||||
if (_timeRange.size === 1) {
|
||||
// check if the first selected value is within first day
|
||||
const selectedDay = Math.ceil(Math.min(..._timeRange) / 24);
|
||||
if (selectedDay !== 1) {
|
||||
const firstSelectedHour = Math.ceil(Math.max(..._timeRange));
|
||||
if (firstSelectedHour > 23) {
|
||||
return setError('Select a time on the initial day!');
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user