fmidev / weather-app

FMI's official weather application for mobile devices
7 stars 2 forks source link

issue-601: Use 15:00 local time for daily weather symbol if available #614

Closed geosaaga closed 2 months ago

geosaaga commented 2 months ago

14:00 local time was used before the change. There was also other issue

The code

  const index = dayArray.findIndex((d) => {
    const dateObj = new Date(d.epochtime * 1000);
    const hours = dateObj.getHours();
    return hours === 14;
  });

used device local time and didn't work for foreign locations. Removed code, because it returned random indexes for foreign locations. The zero index is returned instead, because it is closest to 15:00 if that time is passed already.