firestormforum / firestorm

An open-source forum engine, with an Elixir+Phoenix backend and an Elm frontend.
http://www.firestormforum.org
MIT License
967 stars 87 forks source link

progressively fuzzier timestamps #5

Open Trevoke opened 7 years ago

Trevoke commented 7 years ago

Right now they're just rounded to something relatively meaningful but, for instance, there's a thread from 13 days ago. That's too much effort, it's just two weeks, who cares that it's not 15 days?

when it happened what I want to read
just now a few seconds ago
45 seconds ago 45 seconds ago
4 minutes ago 4 minutes ago
1h50 min ago 2 hours ago
6 days ago 1 week ago
13 days ago 2 weeks ago
1 month and 26 days ago 2 months ago
knewter commented 7 years ago

We're using moment.js for the fuzzy time replacement on the frontend right now. What are the odds that this is easy to configure there?

Trevoke commented 7 years ago

It looks like http://momentjs.com/docs/#/displaying/tonow/ is how it's configured by default and it does some kind of increasing fuzziness, just not "what I want".

It looks like there's some element of "customizing thresholds" : http://momentjs.com/docs/#/customization/relative-time-threshold/ but they don't do "weeks" apparently ?

There's a plugin that rounds a date time to a given interval, which might be useful: http://momentjs.com/docs/#/plugins/round/

(of course, since the library already does that, just not how I want, maybe we can ignore this.. Or ask the community

knewter commented 7 years ago

I've applied a 'feedback requested' label and for now am removing this from the alpha milestone since it's kind of ok but I agree it's a bit silly