unidata 0.0.8 → 0.0.9

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.
@@ -3,18 +3,18 @@ require 'date'
3
3
  module Unidata
4
4
  module Extensions
5
5
  module Date
6
- PICK_EPOCH = ::Date.parse('1968-01-01')
6
+ PICK_DAY_ZERO = ::Date.parse('1967-12-31')
7
7
 
8
8
  def typecast(value)
9
9
  value.kind_of?(::Date) ? value : value.send(:to_date)
10
10
  end
11
11
 
12
12
  def to_unidata(value)
13
- (value - PICK_EPOCH).to_i
13
+ (value - PICK_DAY_ZERO).to_i
14
14
  end
15
15
 
16
16
  def from_unidata(value)
17
- PICK_EPOCH + value.to_i
17
+ PICK_DAY_ZERO + value.to_i
18
18
  end
19
19
  end
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module Unidata
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -181,7 +181,7 @@ describe Unidata::Field do
181
181
  context 'when type is Date' do
182
182
  it 'converts value to pick time' do
183
183
  field = subject.new(1, :created_on, Date)
184
- field.to_unidata(Date.parse('2012-04-03')).should == 16164
184
+ field.to_unidata(Date.parse('2012-04-03')).should == 16165
185
185
  end
186
186
  end
187
187
 
@@ -218,7 +218,7 @@ describe Unidata::Field do
218
218
  context 'when type is Date' do
219
219
  it 'converts value from pick time' do
220
220
  field = subject.new(1, :created_on, Date)
221
- field.from_unidata(16164).should == Date.parse('2012-04-03')
221
+ field.from_unidata(16165).should == Date.parse('2012-04-03')
222
222
  end
223
223
  end
224
224
 
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: unidata
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.8
5
+ version: 0.0.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jeremy Israelsen
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-02 00:00:00.000000000 Z
12
+ date: 2013-01-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake