merch_calendar 1.0.0 → 1.0.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 627dcc9354c714a576a3865687b2004941b29daf
|
|
4
|
+
data.tar.gz: 5ad02cf9fcfedf7b1aefe1e6278792b2194d2d0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5d644ac6318e0efe7b3d668194c4f1cb6e8cc3045a08e816b9adefc8d8ca8c3eeec7c073ff917f7469aa1fbaa96b91d3c0ea68d285786816f3416cf996632cf3
|
|
7
|
+
data.tar.gz: 7a8303fe3f4b19419d1b8998eb775c1ff51b67df7335be285b3408c3e5397badcd42bbd2133608bf4d0a1630827bf7527caf493cff83b3a021d8bc4bf151967b
|
|
@@ -2,7 +2,9 @@ require "date"
|
|
|
2
2
|
|
|
3
3
|
module MerchCalendar
|
|
4
4
|
class RetailCalendar
|
|
5
|
-
|
|
5
|
+
LAST_MONTH_OF_THE_YEAR = "January"
|
|
6
|
+
LAST_DAY_OF_THE_YEAR = 31
|
|
7
|
+
|
|
6
8
|
QUARTER_1 = 1
|
|
7
9
|
QUARTER_2 = 2
|
|
8
10
|
QUARTER_3 = 3
|
|
@@ -16,7 +18,7 @@ module MerchCalendar
|
|
|
16
18
|
# @param year [Integer] the retail year
|
|
17
19
|
# @return [Date] the first date of the retail year
|
|
18
20
|
def end_of_year(year)
|
|
19
|
-
year_end = Date.new((year + 1),
|
|
21
|
+
year_end = Date.new((year + 1), Date::MONTHNAMES.index(LAST_MONTH_OF_THE_YEAR), LAST_DAY_OF_THE_YEAR) # Jan 31st
|
|
20
22
|
wday = (year_end.wday + 1) % 7
|
|
21
23
|
|
|
22
24
|
if wday > 3
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
module MerchCalendar
|
|
2
2
|
class StitchFixFiscalYearCalendar
|
|
3
|
+
LAST_MONTH_OF_THE_YEAR = "July"
|
|
4
|
+
LAST_DAY_OF_THE_YEAR = 31
|
|
3
5
|
|
|
4
6
|
QUARTER_1 = 1
|
|
5
7
|
QUARTER_2 = 2
|
|
@@ -22,7 +24,7 @@ module MerchCalendar
|
|
|
22
24
|
# @param year [Integer] the fiscal year
|
|
23
25
|
# @return [Date] the last date of the fiscal year
|
|
24
26
|
def end_of_year(year)
|
|
25
|
-
year_end = Date.new((year),
|
|
27
|
+
year_end = Date.new((year), Date::MONTHNAMES.index(LAST_MONTH_OF_THE_YEAR), LAST_DAY_OF_THE_YEAR) # Jul 31st
|
|
26
28
|
wday = (year_end.wday + 1) % 7
|
|
27
29
|
|
|
28
30
|
if wday > 3
|
data/owners.json
ADDED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: merch_calendar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mitch Dempsey
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2017-
|
|
12
|
+
date: 2017-12-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rake
|
|
@@ -107,6 +107,7 @@ files:
|
|
|
107
107
|
- lib/merch_calendar/util.rb
|
|
108
108
|
- lib/merch_calendar/version.rb
|
|
109
109
|
- merch_calendar.gemspec
|
|
110
|
+
- owners.json
|
|
110
111
|
- spec/merch_calendar/merch_week_spec.rb
|
|
111
112
|
- spec/merch_calendar/retail_calendar_spec.rb
|
|
112
113
|
- spec/merch_calendar/stitch_fix_fiscal_year_calendar_spec.rb
|