Don't Let Time Zones Ruin Your Day
summary
Built a weather app Please Don't Rain using WeatherKit and SwiftUI and hits concrete bugs: charts show wrong start-of-day because Calendar.current and default Date.FormatStyle use the device TZ; the chart unit argument plots midpoints so line/bar data gaps appear; WeatherKit day vs hour dates disagree in places like Nepal 5:45 offset; fixes are to create a custom TimeZone+Calendar, pass a Date.FormatStyle with that TZ, drop the unit argument, reformat hour entries, and add dark‑mode aware axis labels for accessibility.
AI-written summary · about
chapters (14)
- 0:00Introduction and background
- 0:54Developer journey and story
- 2:34Notable quotes on time zones
- 4:09Project context and goals
- 6:58The dangers of manual dates
- 9:41Leveraging built-in tools
- 13:50Addressing logic bugs
- 15:32Implementing robust time logic
- 18:50Solving chart rendering gaps
- 21:11UTC offset pitfalls
- 22:15Framework behavior nuances
- 24:56Environment-based rendering
- 26:32Accessibility and styling
- 28:35Final recap and takeaways








