Permalink
Browse files

Default to_s for Date and Time

  • Loading branch information...
1 parent 32dae67 commit 51a0dd6c0c5c905e44bff9b5122dc8f64411350c Joe Peck committed Jan 18, 2013
Showing with 4 additions and 6 deletions.
  1. +0 −4 app/helpers/application_helper.rb
  2. +2 −2 app/models/timeslot.rb
  3. +2 −0 config/initializers/time_formats.rb
@@ -7,8 +7,4 @@ def display_winning_time(event)
"None"
end
end
-
- def display_datetime(datetime)
- datetime.strftime("%A, %l%P")
- end
end
View
@@ -7,8 +7,8 @@ class Timeslot < ActiveRecord::Base
validates_presence_of :event_id, :starts_at
def to_s
- range = starts_at.strftime("%A, %l%P")
- range << " - #{ends_at.strftime("%A, %l%P")}" if ends_at
+ range = starts_at.to_s
+ range << " - #{ends_at}" if ends_at
return range
end
end
@@ -0,0 +1,2 @@
+Time::DATE_FORMATS[:default] = "%m/%d/%Y %I:%M %p"
+Date::DATE_FORMATS[:default] = "%m/%d/%Y"

0 comments on commit 51a0dd6

Please sign in to comment.