forex_date 1.0.2 → 1.0.3

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.
data/README.md CHANGED
@@ -6,11 +6,13 @@ A forex week begins when the Wellington/Sydney forex markets open (Sun 5pm EST)
6
6
 
7
7
  In order to calculate daily OHCL bars, the around the clock forex week can be split in 5 days:
8
8
 
9
- monday: from Sun 5pm EST to Mon EST 5pm
10
- tuesday: from Mon 5pm EST to Tue EST 5pm
11
- wednesday: from Tue 5pm EST to Wed EST 5pm
12
- thursday: from Wed 5pm EST to Thu EST 5pm
13
- friday: from Thu 5pm EST to Fri EST 5pm
9
+ | day | from | to |
10
+ |:-----------|:-------------|:-------------|
11
+ | monday | Sun 5pm EST | Mon 5pm EST |
12
+ | tuesday | Mon 5pm EST | Tue 5pm EST |
13
+ | wednesday | Tue 5pm EST | Wed 5pm EST |
14
+ | thursday | Wed 5pm EST | Thu 5pm EST |
15
+ | friday | Thu 5pm EST | Fri 5pm EST |
14
16
 
15
17
  For example, if current time is Thu May 24 06:38:34 UTC 2012:
16
18
 
@@ -1,3 +1,3 @@
1
1
  module ForexDate
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
data/lib/forex_date.rb CHANGED
@@ -4,10 +4,10 @@ module ForexDate
4
4
 
5
5
  require 'tzinfo'
6
6
 
7
- def ForexDate.now
7
+ def ForexDate.today
8
8
  t = Time.now.in_time_zone("Eastern Time (US & Canada)")
9
9
  date = t.to_date
10
- date += 1.day if t.hour > 17
10
+ date += 1.day if t.hour >= 17
11
11
  return ( date.wday == 6 || date.wday == 7 ) ? nil : date
12
12
  end
13
13
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forex_date
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Javier Vidal
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-26 00:00:00 Z
18
+ date: 2012-05-30 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: tzinfo