diff --git a/src/hooks/useCodapData.ts b/src/hooks/useCodapData.ts index 2da1a73..ec26549 100644 --- a/src/hooks/useCodapData.ts +++ b/src/hooks/useCodapData.ts @@ -42,8 +42,7 @@ export const useCodapData = () => { const calcOptions: DaylightCalcOptions = { latitude: Number(latitude), longitude: Number(longitude), - year: 2024, //TODO: If data are to be historical, add dynamic year attribute - useRealTimeZones: true + year: 2024 // NOTE: If data are to be historical, add dynamic year attribute }; const solarEvents = getDayLightInfo(calcOptions); diff --git a/src/types.ts b/src/types.ts index 877b2e6..23f84e5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -10,7 +10,6 @@ export interface DaylightCalcOptions { latitude: number; longitude: number; year: number; - useRealTimeZones: boolean; } export interface DaylightInfo { diff --git a/src/utils/daylight-utils.ts b/src/utils/daylight-utils.ts index 6ddb5ec..994d164 100644 --- a/src/utils/daylight-utils.ts +++ b/src/utils/daylight-utils.ts @@ -82,7 +82,7 @@ export function getSunrayAngleInDegrees(dayNum: number, earthTilt: number, lat:n } export function getDayLightInfo(options: DaylightCalcOptions): DaylightInfo[] { - const { latitude, longitude, year, useRealTimeZones } = options; + const { latitude, longitude, year } = options; const results: DaylightInfo[] = []; let currentDay = dayjs.utc(`${year}-01-01`); @@ -95,15 +95,8 @@ export function getDayLightInfo(options: DaylightCalcOptions): DaylightInfo[] { // TODO: handle above arctic circle and below antarctic circle const utcSunrise = dayjs(getSunrise(latitude, longitude, date)); const utcSunset = dayjs(getSunset(latitude, longitude, date)); - - // TODO: Consider removing fake timezone option entirely - const tzSunrise = useRealTimeZones - ? utcSunrise.tz(timeZone) - : utcSunrise.add(Math.round(longitude / 15), "hour"); - - const tzSunset = useRealTimeZones - ? utcSunset.tz(timeZone) - : utcSunset.add(Math.round(longitude / 15), "hour"); + const tzSunrise = utcSunrise.tz(timeZone) + const tzSunset = utcSunset.tz(timeZone) const record: DaylightInfo = { day: currentDay.format("YYYY-MM-DD"),