Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.
/ time_distance Public archive

Elixir library to calculate display distance between two dates (or a date and now), similar to distance_of_time_in_words

License

Notifications You must be signed in to change notification settings

aussiegeek/time_distance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TimeDistance

Build Status Inline docs

Show the difference between two specified times, or between a specified time and now

Example results:

  • 2 seconds ago
  • 6 months ago
  • 3 days
  • 2 years

Works with Elixir time structs or Timex

A rough port of distance_of_time_in_words from Ruby on Rails

Installation

  1. Add time_distance to your list of dependencies in mix.exs:

    def deps do [{:time_distance, "~> 0.0.1"}] end

  2. Ensure time_distance is started before your application:

    def application do [applications: [:time_distance]] end

About

Elixir library to calculate display distance between two dates (or a date and now), similar to distance_of_time_in_words

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages