since_when 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +16 -2
- data/lib/since_when/version.rb +1 -1
- data/lib/since_when.rb +1 -0
- metadata +1 -1
data/README.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
Returns a string containing the amount of time since the date given with
|
4
4
|
varying scopes of specificy.
|
5
5
|
|
6
|
+
**Currently on the drawing board:
|
7
|
+
* Support for weeks
|
8
|
+
|
6
9
|
## Installation
|
7
10
|
|
8
11
|
Add this line to your application's Gemfile:
|
@@ -17,11 +20,22 @@ Or install it yourself as:
|
|
17
20
|
|
18
21
|
$ gem install since_when
|
19
22
|
|
23
|
+
**Make sure the date gem is required in app as well
|
24
|
+
|
20
25
|
## Usage
|
21
26
|
|
22
|
-
SinceWhen::time_since( date, :scope )
|
27
|
+
SinceWhen::time_since( date, :scope = optional )
|
28
|
+
|
29
|
+
* date can be a Date object, DateTime object, or anything else that can be turned into a DateTime object (ie. ActiveSupport::TimeWithZone)
|
30
|
+
* Scope can be any of the following:
|
31
|
+
* :year
|
32
|
+
* :month (default)
|
33
|
+
* :day
|
34
|
+
* :hour
|
35
|
+
* :minute
|
36
|
+
* :second
|
23
37
|
|
24
|
-
Example:
|
38
|
+
## Example:
|
25
39
|
|
26
40
|
example_date = Date.new(2001, 2, 3)
|
27
41
|
|
data/lib/since_when/version.rb
CHANGED
data/lib/since_when.rb
CHANGED