Skip to content

jayelkaake/hublot

 
 

Repository files navigation

Hublot

Hublot makes Facebook-style datetime-contextual datetimes a cinch for your ActiveRecord objects.

Examples

Comment created just now:

just now

Comment created seconds or minutes ago

10 seconds ago
2 minutes ago

Comment created an hour or less than 24 hours ago

an hour ago
4 hours ago

Comment created today

Today at 5:30PM

Comment created yesterday

Yesterday at 5:30PM

Comment created this week

Monday at 5:30PM

Comment created last week

Last Monday at 5:30PM

After that:

Monday, July 1 at 5:30PM

Use

gem "hublot", "~> 0.0.6"

Call the pretty method in your views:

<%= @comment.created_at.pretty %>

About

Datetime-sensitive datetime humanizer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 96.0%
  • JavaScript 1.8%
  • CSS 1.5%
  • HTML 0.7%