app/models/festivity_performance.rb in trusty-festivity-extension-2.1.1 vs app/models/festivity_performance.rb in trusty-festivity-extension-2.2.0
- old
+ new
@@ -1,9 +1,10 @@
class FestivityPerformance < ActiveRecord::Base
validates_presence_of :event_page_id
belongs_to :festivity_event_page, foreign_key: :event_page_id
belongs_to :festivity_location_page, foreign_key: :location_page_id
+ default_scope {order :start_date}
attr_accessible :start_date, :end_date, :festivity_location_page, :notes
def start_date=(date)
super(parse_date(date))
@@ -18,11 +19,10 @@
end
private
def parse_date(date)
- time = Time.strptime("#{date}", '%m/%d/%Y %I:%M %p')
- Time.zone.local(time.year, time.month, time.day, time.hour, time.min, time.sec)
+ Time.parse(Time.strptime(date, "%m/%d/%Y %l:%M %P").to_s)
rescue
nil
end
end
\ No newline at end of file