mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-04 02:05: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
|
// function for handling the selected time from the provided list
|
||||||
const handleTime = useCallback(
|
const handleTime = useCallback(
|
||||||
(hour) => {
|
(hour) => {
|
||||||
if (!hour) return;
|
if (isNaN(hour)) return;
|
||||||
|
|
||||||
const _timeRange = new Set([...timeRange]);
|
const _timeRange = new Set([...timeRange]);
|
||||||
_timeRange.add(hour);
|
_timeRange.add(hour);
|
||||||
@ -96,8 +96,8 @@ const TimePicker = ({ dateRange, onChange }) => {
|
|||||||
//update after
|
//update after
|
||||||
if (_timeRange.size === 1) {
|
if (_timeRange.size === 1) {
|
||||||
// check if the first selected value is within first day
|
// check if the first selected value is within first day
|
||||||
const selectedDay = Math.ceil(Math.min(..._timeRange) / 24);
|
const firstSelectedHour = Math.ceil(Math.max(..._timeRange));
|
||||||
if (selectedDay !== 1) {
|
if (firstSelectedHour > 23) {
|
||||||
return setError('Select a time on the initial day!');
|
return setError('Select a time on the initial day!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user