I noticed a strange bug when choosing the weather forecast for Miami or Los Angeles.
First, the sunset and sunrise times are displayed incorrectly.
Second, the icons are displayed incorrectly - when there should be a moon, the sun is displayed. And when there should be a sun, the moon is displayed.
https://1drv.ms/i/c/2c46d963b5394152/EXz6NAeh61VNlu0FIeu2UlgBK15_f64XMCS-YMmYVSJQCw?e=GReokH
I am developing my site for educational purposes (maybe I'll let it work).
https://alexkobylansky.github.io/weather-forecast
So, I make the following request to your server for the city of Los Angeles:
https://api.openweathermap.org/data/2.5/weather?lat=34.0549076&lon=-118.24264299999999&units=metric&lang=en&appid=
I get data in the form of timestamp about sunrise and sunset in the sys object, then I process them in the following way:
const timestampConversation = (t: number) => { const now = getDay(t * 1000); let hour: string | number = now.getHours(); let minute: string | number = now.getMinutes(); hour = (hour < 10) ? 0${hour}: hour; minute = (minute < 10) ?0${minute}: minute; return${hour}:${minute} };
For most cities this works correctly. But for some reason, when choosing, for example, Los Angeles, the sunset and sunrise times are displayed incorrectly, and your sun and moon icons do not come correctly.
I noticed a strange bug when choosing the weather forecast for Miami or Los Angeles.
First, the sunset and sunrise times are displayed incorrectly.
Second, the icons are displayed incorrectly - when there should be a moon, the sun is displayed. And when there should be a sun, the moon is displayed.
https://1drv.ms/i/c/2c46d963b5394152/EXz6NAeh61VNlu0FIeu2UlgBK15_f64XMCS-YMmYVSJQCw?e=GReokH
I am developing my site for educational purposes (maybe I'll let it work).
https://alexkobylansky.github.io/weather-forecast
So, I make the following request to your server for the city of Los Angeles:
https://api.openweathermap.org/data/2.5/weather?lat=34.0549076&lon=-118.24264299999999&units=metric&lang=en&appid=
I get data in the form of timestamp about sunrise and sunset in the sys object, then I process them in the following way:
const timestampConversation = (t: number) => { const now = getDay(t * 1000); let hour: string | number = now.getHours(); let minute: string | number = now.getMinutes(); hour = (hour < 10) ?0${hour}: hour; minute = (minute < 10) ?0${minute}: minute; return${hour}:${minute}};For most cities this works correctly. But for some reason, when choosing, for example, Los Angeles, the sunset and sunrise times are displayed incorrectly, and your sun and moon icons do not come correctly.