SolarArbiter / solarforecastarbiter-dashboard

Templates and code for rendering the Solar Forecast Arbiter dashboard.
https://dashboard.solarforecastarbiter.org
MIT License
9 stars 6 forks source link

Support Report Timezone #425

Closed lboeman closed 3 years ago

lboeman commented 3 years ago

closes #423 Adds the option for a user to supply a timezone for a report, with the default option being "Infer from selections. I've dropped it in right above the start/end inputs like so: Screenshot from 2021-07-21 14-44-07

lboeman commented 3 years ago

A little weird to specify a timezone but then be forced to input start/end in UTC. Can we do better with reasonable effort?

Yes. I'll update that.

lboeman commented 3 years ago

I've updated the javascript to keep the timezone labels on the report form in sync with the selected timezone. When a user changes the timezone, the date/time stays the same because it seemed to me that it would be more common to enter times and then realize you forgot to change the timezone and not want to reenter dates. But that could be adjusted if there is utility in adjusting time appropriately as the timezone is altered.

I also have the code parsing the report's start/end and then localizing so that if we update timezones on any old reports, (where start/end are in UTC) cloning report parameters gives you the correct times.

lboeman commented 3 years ago

@wholmgren I did confirm that current behavior is as we discussed. The stored value returned from the API is first localized to UTC and then adjusted to a timezone IF one exists.

Also updated the / to - and spaces after start. It seems like it would take more time than I'd like to spend to implement 0 padded numbers here, so we can save it for future work if needed.