bikehopper / bikehopper-ui

Friendly bike+transit directions (frontend)
Other
27 stars 2 forks source link

Fix: Initialize datetime input properly #254

Closed graue closed 1 year ago

graue commented 1 year ago

Another annoyance fix.

When you switch departure from "Now" to "Depart at" or "Arrive by," the datetime input should initialize to either the current time or 2 hours from now respectively. This was broken because <input type="datetime-local"> only accepts values in this bespoke format:

2018-06-12T19:30

and was being passed UNIX timestamps (number of ms since epoch) instead.

I've also changed the code to always keep normal timestamps in the Redux store, and use the bespoke string format only within TimeBar.