merch_calendar 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0325ba6521496a2043a1abacc779ab8fee857ba0
4
- data.tar.gz: 13621f1cde48c5097e07debf1f46e43becf3f7b7
3
+ metadata.gz: 627dcc9354c714a576a3865687b2004941b29daf
4
+ data.tar.gz: 5ad02cf9fcfedf7b1aefe1e6278792b2194d2d0b
5
5
  SHA512:
6
- metadata.gz: ee990e81e979a167c5ef882280d9c9be11eae652e6d7c437db6d306caee28230c7fb3f4e36864ba912f65329d90a779319e69e6210ca941fa2d46746fd7d481f
7
- data.tar.gz: b0cdff703e3e26cced58d342cce2297b4c94a5dc9147581ac3a445c99208f125f1f7f12d671f08be65f8bf1d6437a940cbbbf88b74c12c1074057da54c876e19
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), 1, -1) # Jan 31st
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), 7, -1) # Jul 31st
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
@@ -1,3 +1,3 @@
1
1
  module MerchCalendar
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -0,0 +1,7 @@
1
+ {
2
+ "owners": [
3
+ {
4
+ "team": "erch"
5
+ }
6
+ ]
7
+ }
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.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-09-18 00:00:00.000000000 Z
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