lib/calendar_sniper.rb in calendar_sniper-1.1.2 vs lib/calendar_sniper.rb in calendar_sniper-1.1.3
- old
+ new
@@ -1,7 +1,10 @@
require "calendar_sniper/version"
require 'active_support'
+require 'active_support/core_ext/date'
+require 'active_support/core_ext/date_time'
+require 'active_support/core_ext/time'
module CalendarSniper
extend ActiveSupport::Concern
included do
@@ -34,10 +37,10 @@
private
def coalesce_date(from_date_or_string, by_direction)
if from_date_or_string.is_a?(String)
- date_from_string = DateTime.strptime(from_date_or_string, date_format_for_string(from_date_or_string))
+ date_from_string = Time.strptime(from_date_or_string, date_format_for_string(from_date_or_string))
set_time_for_direction(date_from_string, by_direction)
else
set_time_for_direction(from_date_or_string, by_direction)
end
end