Fix timezone conversion logic (#11444)

* Fix timezone conversion logic

* Use function for consistency

* Cleanup
This commit is contained in:
Nicolas Mowen
2024-05-20 07:02:19 -06:00
committed by GitHub
parent 82d4bf8ab5
commit 2a16d5593a
5 changed files with 23 additions and 27 deletions

View File

@@ -12,7 +12,7 @@ import ActivityIndicator from "@/components/indicators/activity-indicator";
import { VideoResolutionType } from "@/types/live";
import axios from "axios";
import { cn } from "@/lib/utils";
import { getUTCOffset } from "@/utils/dateUtil";
import { getTimestampOffset } from "@/utils/dateUtil";
/**
* Dynamically switches between video playback and scrubbing preview player.
@@ -149,8 +149,7 @@ export default function DynamicVideoPlayer({
// state of playback player
const recordingParams = useMemo(() => {
const timeRangeOffset =
(getUTCOffset(new Date(timeRange.before * 1000)) % 60) * 60;
const timeRangeOffset = getTimestampOffset(timeRange.before);
return {
before: timeRange.before + timeRangeOffset,