lib/todoist/util/parse_helper.rb in todoist-ruby-0.1.3 vs lib/todoist/util/parse_helper.rb in todoist-ruby-0.2.1
- old
+ new
@@ -2,34 +2,34 @@
module Todoist
module Util
class ParseHelper
- def self.utcOffsetHours
+ def self.utc_offset_hours
return Time.now.utc_offset/60/60
end
- def self.parseTodoistDate(item, key)
+ def self.parse_todoist_date(item, key)
if item[key]
time = Time.parse(item[key])
return time.to_datetime
else
return nil
end
end
- def self.filterToday(item, key)
+ def self.filter_today(item, key)
now = DateTime.now
- if parseTodoistDate(item, key) && parseTodoistDate(item, key) <= DateTime.new(now.year, now.month, now.day, -utcOffsetHours) + 1
+ if parse_todoist_date(item, key) && parse_todoist_date(item, key) <= DateTime.new(now.year, now.month, now.day, -utc_offset_hours) + 1
return true
else
return false
end
end
- def self.formatTime(datetime)
+ def self.format_time(datetime)
datetime.strftime("%Y-%m-%dT%H:%M")
end
def self.make_objects_as_array(object_datas, key = "id")
objects_as_array = []