Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
* master:
  fixed issue with times between 12pm and 1pm not being calculated correctly into 24h times
ttscoff committed May 9, 2013

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents e317b2b + 764f17c commit d3850ee
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions plugins_disabled/facebookifttt.rb
Original file line number Diff line number Diff line change
@@ -27,6 +27,8 @@
- You should set facebook_ifttt_input_file to this value, substituting username appropriately.
=end

require 'date'

config = {
'description' => ['Parses Facebook posts logged by IFTTT.com',
'facebook_ifttt_input_file is a string pointing to the location of the file created by IFTTT.',
@@ -90,14 +92,8 @@ def do_log
line = line.gsub(',', '')

month, day, year, time = line.split
hour,min = time.split(/:/)
min = min.gsub(ampm, '')

if line =~ pm
x = hour.to_i
x += 12
hour = x.to_s
end
parseTime = DateTime.parse(time).strftime("%H:%M")
hour,min = parseTime.split(/:/)

month = Date::MONTHNAMES.index(month)
ltime = Time.local(year, month, day, hour, min, 0, 0)

0 comments on commit d3850ee

Please sign in to comment.