nitinthewiz / ghost-phantom

Phantom theme for Ghost
MIT License
433 stars 121 forks source link

Relative timestamps for post dates #25

Closed ghost closed 9 years ago

ghost commented 9 years ago

Display relative timestamps for post dates like "Published 33 minutes ago", as well as a tooltip like "February 28 '15 at 8:51".

It uses both the server-side "date" helper to generate them initially and then uses jquery-timeago to update them on the client-side as time passes (if JS is disabled client-side it'll still display the original date generated on the server but obviously won't update).

haydenbleasel commented 9 years ago

@frenchtouch Awesome! Can I get 2 things before I merge this though:

Cheers :+1:

ghost commented 9 years ago

There you go. :)

screenshot from 2015-02-28 15 25 44

There's the screenshot, unfortunately I couldn't take the tooltip as well but its format is MMMM D [']YY [at] H:mm which translates to February 1 '15 at 9:41 (it's the same format Stack Exchange uses, the only exception being that they don't display the year if it's still the current one, something I don't think is possible without reimplementing Ghost's date helper so I default to always displaying the year).

haydenbleasel commented 9 years ago

All good :+1:

ghost commented 9 years ago

Cool, have a great day :)

haydenbleasel commented 9 years ago

You too!