commercial_weeks 0.2.0 → 0.2.1
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 +26 -1
- data/commercial_weeks-0.1.0.gem +0 -0
- data/commercial_weeks-0.2.0.gem +0 -0
- data/lib/commercial_weeks.rb +0 -2
- data/lib/commercial_weeks/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29fa85f32844366864d8f2651c5df7a75c428bc2
|
|
4
|
+
data.tar.gz: c7f5a8d8327a54f1e1474ff30c60ce58517a3878
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6442c14b3cd0e13a801c8946ab3a6cab28819fe31b559d358831cd94eff852eb8e8f03318ea7d46e239785ad2ba8bbc8319a9d972210a4e3e1d1944f913ae9ec
|
|
7
|
+
data.tar.gz: 6dbcd4936ad3628e91c60338fe964bba3648c371b832cbc2d251f19f3118ebd3babcbd7569cf4965997ecb0288a8cecbb07a3adfe6e17c0723e6ee1544a447fe
|
data/README.md
CHANGED
|
@@ -22,7 +22,32 @@ Or install it yourself as:
|
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Computes start date and end date for week
|
|
26
|
+
CommercialWeeks.week_dates(week_num, year)
|
|
27
|
+
|
|
28
|
+
Computes number of weeks in a year
|
|
29
|
+
CommercialWeeks.weeks_count(year)
|
|
30
|
+
|
|
31
|
+
Compute first week of the year
|
|
32
|
+
CommercialWeeks.get_first_week(year=Time.now.year)
|
|
33
|
+
|
|
34
|
+
Calculate weeks based the startign and ending weeks
|
|
35
|
+
CommercialWeeks.calculate_weeks(start_week, end_week, year)
|
|
36
|
+
|
|
37
|
+
Calculate previous half year weeks
|
|
38
|
+
CommercialWeeks.previous_half_year_weeks(year)
|
|
39
|
+
|
|
40
|
+
Calculate previous half year weeks
|
|
41
|
+
CommercialWeeks.next_half_year_weeks(year)
|
|
42
|
+
|
|
43
|
+
Compute weeks for the year
|
|
44
|
+
CommercialWeeks.compute_weeks(year=Time.now.year)
|
|
45
|
+
|
|
46
|
+
Computes week for the given date
|
|
47
|
+
CommercialWeeks.current_week(current_date)
|
|
48
|
+
|
|
49
|
+
Compute weeks start date
|
|
50
|
+
CommercialWeeks.start_date_of_week(date)
|
|
26
51
|
|
|
27
52
|
## Development
|
|
28
53
|
|
|
Binary file
|
|
Binary file
|
data/lib/commercial_weeks.rb
CHANGED
|
@@ -8,8 +8,6 @@ module CommercialWeeks
|
|
|
8
8
|
def self.week_dates(week_num, year)
|
|
9
9
|
week_start = Date.commercial(year, week_num, 1)
|
|
10
10
|
week_end = Date.commercial(year, week_num, 7)
|
|
11
|
-
p week_start
|
|
12
|
-
p week_end
|
|
13
11
|
week_end = Date.new(year).end_of_year if week_end.year > week_start.year
|
|
14
12
|
[week_start.strftime('%d %b, %Y'), week_end.strftime('%d %b, %Y')].join(' - ')
|
|
15
13
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: commercial_weeks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- usman
|
|
@@ -69,6 +69,8 @@ files:
|
|
|
69
69
|
- Rakefile
|
|
70
70
|
- bin/console
|
|
71
71
|
- bin/setup
|
|
72
|
+
- commercial_weeks-0.1.0.gem
|
|
73
|
+
- commercial_weeks-0.2.0.gem
|
|
72
74
|
- commercial_weeks.gemspec
|
|
73
75
|
- lib/commercial_weeks.rb
|
|
74
76
|
- lib/commercial_weeks/version.rb
|