beeminder / road

Beebrain and Visual Graph Editor
http://graph.beeminder.com
Other
13 stars 3 forks source link

If tmin is negative, treat it as relative to now #276

Open dreeves opened 2 years ago

dreeves commented 2 years ago
### Desiderata
- [ ] Add the if-statement for tmin in beebrain.js
- [x] Unsnooze the beebody gissue to make it work in the UI somehow

Madge in Discord: Feature request: make the x-axis able to show eg "the past year" as opposed to either custom date or all data as some of my graphs I don't like getting too big and updating is annoying

Cognata

Verbata: relative tmin, t-min, xmin, x-min, anti-magic?, magic strings, hms parsafore,

dreeves commented 2 years ago

Wait, I guess tmin is passed as a daystamp like "2022-09-06" so there's no such thing as "if it's negative". I guess we need special syntax like "now-14d" or something? I do have javascript code handy for parsing amounts of time like that, namely my HMS Parsafore library.

dreeves commented 4 weeks ago

Update: Thanks to gbear605 for pointing out that there's an ISO standard for relative date/time. But also we're just handling the logic for this in Beebody so Beebrain can just continue to always get an absolute daystamp. If the user opts for relative tmin (aka x-min) then Beebody does the math and sends the dynamically computed absolute tmin each time it asks Beebrain for the graph.

Meaning there's nothing for Beebrain to do here, at the moment.

But maybe in the future we could decide it's cleaner to let Beebody pass along whatever the user opted for -- absolute or relative tmin -- and let Beebrain handle it.