Closed JGreenlee closed 6 months ago
Here is what the datepicker now shows on the initial load:
Switched to using arrow
instead of datetime
.
We do not import
from datetime
anymore, although the datetime
object is still used internally (by pandas
and by arrow
itself)
Added a dropdown for UTC time vs. Local timezone (as described in https://github.com/e-mission/op-admin-dashboard/issues/73#issuecomment-1908770258)
UI now looks like this:
|
|
As it turns out, the datepicker does not keep current to "today's" date for the selection. Today, a user reported that the datepicker only allowed them to retrieve data up to January 15 (despite the date today being January 31).
The reason for this is to do with how Plotly Dash works – the DatePicker component gets generated once when the dashboard is deployed, and does not update on every page load. Our last production deployment was Jan 15, so that is what it is locked to.
Described in https://community.plotly.com/t/refreshing-the-start-date-everyday-for-datepickersingle/22234
According to https://dash.plotly.com/live-updates ("Updates on Page Load"), if we define the page content as a function rather than a variable, it will be generated on each page load / refresh.
Fixed in d9c7df2915431b9fd0258e4502e0bd31a2083a3e
To prove that it was actually updating and for the purpose of testing, I injected a simple Span
with a fully printed out datetime.
Every time I refresh, the 'seconds' updates, which proves that the controls are being re-computed.
set initial date range on datepicker
use unambiguous format on datepicker (D MMM Y)