month_date 0.0.4 → 0.0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +29 -1
- data/lib/month_date/version.rb +1 -1
- data/lib/month_date.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42fb0bc11febb111288c5b56876e57f63cee3769
|
4
|
+
data.tar.gz: dea7db401fa0d2e654ceacd74bb4673984238c5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8d7fd92b87f78e911a50e8ba6c0dddff34f894b224f89bd573dbd4e616e0885fd3a5286f9bf3563ebf0c5abd60c61f4b7a1709079cf216b5dbf13085abb55a4
|
7
|
+
data.tar.gz: 46ed663170b9351e3941cf4e9d61a8f36479f2926a371726020609d1f9c0a2c2c36c7c11d92f87990d375b22780364a94c61824c7d7e3f8fc346c62e50ba3a30
|
data/README.md
CHANGED
@@ -1,7 +1,35 @@
|
|
1
1
|
# MonthDate
|
2
2
|
|
3
|
-
|
3
|
+
`month_date` is a ruby gem to help you get the date more easily.
|
4
4
|
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
### get dates in specific week
|
8
|
+
|
9
|
+
MonthDate.week_date_in_month(year, month, week)
|
10
|
+
|
11
|
+
`Example`
|
12
|
+
|
13
|
+
MonthDate.week_date_in_month(2014, 1, 1) # get all Monday dates in 2014/1
|
14
|
+
=> ["20140106", "20140113", "20140120", "20140127"]
|
15
|
+
|
16
|
+
### get dates in range
|
17
|
+
|
18
|
+
MonthDate.dates_in_range(start_date, end_date)
|
19
|
+
|
20
|
+
`Example`
|
21
|
+
MonthDate.dates_in_range("20141230", "20150102")
|
22
|
+
#### parameter
|
23
|
+
##### week
|
24
|
+
|
25
|
+
| 0 | Sunday |
|
26
|
+
|---|-----------|
|
27
|
+
| 1 | Monday |
|
28
|
+
| 2 | Tuesday |
|
29
|
+
| 3 | Wednesday |
|
30
|
+
| 4 | Thursday |
|
31
|
+
| 5 | Friday |
|
32
|
+
| 6 | Saturday |
|
5
33
|
## Installation
|
6
34
|
|
7
35
|
Add this line to your application's Gemfile:
|
data/lib/month_date/version.rb
CHANGED
data/lib/month_date.rb
CHANGED
@@ -19,7 +19,7 @@ module MonthDate
|
|
19
19
|
Date.new(year, month, -1).day
|
20
20
|
end
|
21
21
|
|
22
|
-
def MonthDate.
|
22
|
+
def MonthDate.dates_in_range(start_date, end_date)
|
23
23
|
start_date = Time.parse(start_date.to_s)
|
24
24
|
end_date = Time.parse(end_date.to_s)
|
25
25
|
result = []
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: month_date
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.4
|
4
|
+
version: 0.0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ctxhou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|