WeatherQueries with start/end dates not returning forecast for those dates

try await WeatherService.shared.weather(for: sf, including: .daily(startDate: start, endDate: end))

If the start date is in the past I get an empty forecast. If start date is in the future I just get the current day's forecast. I tried with .hourly as well; got the same problem as I always get hourly data for the current day.

Answered by Engineer in 724289022

Thank you for your report. This is a known issue. We plan to address this soon.

Accepted Answer

Thank you for your report. This is a known issue. We plan to address this soon.

I just tried Xcode Beta 6 and iOS beta 7 -- no change. Will this be fixed before production? If I do not have a chance to verify that it works before I submit to the App Store I will have to remove the functionality from my app.

It turns out that it is working now, but just not the way I expected. It looks like the query only uses the "date" and returns 24 hourly forecasts when I specify a start/end date that is the same. Hmmm.

Thank you again for reporting this issue. It has been addressed.

The WeatherKit API allows one to request historical data for any location from August 1, 2021 until the current time and hourly and daily forecasts for the next 10 days. One may request a combination of historical and forecast data, but requests are limited to a single contiguous 10 day period.

WeatherQueries with start/end dates not returning forecast for those dates
 
 
Q