dwyl / github-backup

:octocat: :back: 🆙 Backup your GitHub Issues so you can still work when (they/you are) offline.
https://github-backup.herokuapp.com
GNU General Public License v2.0
32 stars 3 forks source link

Change the comment time/date format to match Github's #62

Closed Cleop closed 6 years ago

Cleop commented 6 years ago

Currently we display times/dates like this: image image

Whereas we display them like this with dates as numbers and never as a reference to how long ago (for more recent posts): image

If we are trying to stick as closely as possible to github's UI then we could update this. One option to achieve this would be to use the Timex library: https://hexdocs.pm/timex/Timex.html

Timex.from_now(Timex.shift(DateTime.utc_now(), days: -2))
"2 days ago"

Or if we think the library is too bulky for this use case then we could write our own custom version.

nelsonic commented 6 years ago

@Cleop I actually prefer the precise date-time. could we not have both displayed? e.g:

2 days ago (2018-03-06 17:35:38)

So it shows the exact time that the edit/update was made.

Cleop commented 6 years ago

@nelsonic, as you wish. So far I've just been following the 'replicate github' notion but I'm happy to have just precise date-time or both if it's not too cluttered/ users want it.

nelsonic commented 6 years ago

@Cleop yeah, stick with "replicate GitHub UI". We can always add the precise date as a "tool tip" so the UI (on Mobile) is not cluttered.