Skip to content

Commit

Permalink
date parsing change
Browse files Browse the repository at this point in the history
  • Loading branch information
nov committed Oct 5, 2011
1 parent 4e60e99 commit e7bb6f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
fb_graph (2.1.8)
fb_graph (2.1.9)
httpclient (>= 2.2.0.2)
rack-oauth2 (>= 0.9.4)

Expand Down Expand Up @@ -41,8 +41,9 @@ GEM
jruby-openssl (0.7.4)
bouncy-castle-java
json (1.6.1)
json (1.6.1-java)
multi_json (1.0.3)
rack (1.3.3)
rack (1.3.4)
rack-cache (1.0.3)
rack (>= 0.4)
rack-mount (0.8.3)
Expand All @@ -67,10 +68,10 @@ GEM
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
sprockets (2.0.0)
sprockets (2.0.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (!= 1.3.0, ~> 1.1)
tilt (~> 1.1, != 1.3.0)
tilt (1.3.3)
webmock (1.7.6)
addressable (> 2.2.5, ~> 2.2)
Expand Down
12 changes: 6 additions & 6 deletions lib/fb_graph/page/category_attributes.rb
Expand Up @@ -78,14 +78,14 @@ def initialize_with_category_specific_attributes(identifier, attributes = {})
end
end
@@attributes[:date].each do |key|
if attributes[key]
value = if attributes[key] =~ /\d{2}\/\d{2}\/\d{4}/
Date.strptime(attributes[key], '%m/%d/%Y')
else
Date.parse(attributes[key]) rescue attributes[key]
date = if attributes[key]
begin
Date.parse attributes[key]
rescue
attributes[key]
end
self.send :"#{key}=", value
end
self.send :"#{key}=", date
end
@checkin_count = attributes[:checkins]
@hours = {}
Expand Down

0 comments on commit e7bb6f7

Please sign in to comment.