Make DurationSelector test work locally

environments/review-test-fixes-sz4wuk/deployments/2792
Alex Gleason 2023-03-10 14:56:11 -06:00
rodzic 4031e4624c
commit de89a438cc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -21,13 +21,13 @@ const DurationSelector = ({ onDurationChange }: IDurationSelector) => {
const [minutes, setMinutes] = useState<number>(0);
const value = useMemo(() => {
const now: any = new Date();
const future: any = new Date();
now.setDate(now.getDate() + days);
now.setMinutes(now.getMinutes() + minutes);
now.setHours(now.getHours() + hours);
const now = new Date();
const future = new Date();
now.setUTCDate(now.getUTCDate() + days);
now.setUTCMinutes(now.getUTCMinutes() + minutes);
now.setUTCHours(now.getUTCHours() + hours);
return Math.round((now - future) / 1000);
return Math.round((now.getTime() - future.getTime()) / 1000);
}, [days, hours, minutes]);
useEffect(() => {