myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2744] branches/rails2/app/helpers/application_he


From: noreply
Subject: [myexperiment-hackers] [2744] branches/rails2/app/helpers/application_helper.rb: fixed Time. at receiving a different class of object in rails 2
Date: Mon, 24 Oct 2011 16:30:02 -0400 (EDT)

Revision
2744
Author
dgc
Date
2011-10-24 16:30:01 -0400 (Mon, 24 Oct 2011)

Log Message

fixed Time.at receiving a different class of object in rails 2

Modified Paths

Diff

Modified: branches/rails2/app/helpers/application_helper.rb (2743 => 2744)


--- branches/rails2/app/helpers/application_helper.rb	2011-10-24 20:29:30 UTC (rev 2743)
+++ branches/rails2/app/helpers/application_helper.rb	2011-10-24 20:30:01 UTC (rev 2744)
@@ -65,7 +65,7 @@
     if old_dt.is_a?(DateTime)
       rtn = old_dt
     else
-      rtn = Time.at(old_dt)
+      rtn = Time.at(old_dt.time)
     end
     
     return long ? rtn.strftime("%A %d %B %Y @ %H:%M:%S (%Z)") : rtn.strftime("%d/%m/%y @ %H:%M:%S")
@@ -74,7 +74,7 @@
   def date(old_dt, long=true)
     return nil unless old_dt
     
-    rtn = Time.at(old_dt)
+    rtn = Time.at(old_dt.time)
     
     return long ? rtn.strftime("%d %B %Y") : rtn.strftime("%d/%m/%y")
   end

reply via email to

[Prev in Thread] Current Thread [Next in Thread]