<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,11 @@
 module Timely
   module Date
     def at_time(hour = nil, minute = nil, second = nil)
+      if hour.is_a?(Time)
+        time = hour
+        hour, minute, second = time.hour, time.min, time.sec
+      end
+      
       ::Time.local(year, month, day, hour, minute, second)
     end
     </diff>
      <filename>lib/timely/date.rb</filename>
    </modified>
    <modified>
      <diff>@@ -49,6 +49,16 @@ describe Date do
       expected = Time.local(@date.year, @date.month, @date.day, 0, 0, 0)
       @date.at_time.should == expected
     end
+    
+    it 'should accept a time' do
+      lambda { @date.at_time(Time.now) }.should_not raise_error(ArgumentError)
+    end
+    
+    it 'should return the passed-in time on the date' do
+      @time = Time.now - 12345
+      expected = Time.local(@date.year, @date.month, @date.day, @time.hour, @time.min, @time.sec)
+      @date.at_time(@time).should == expected
+    end
   end
   
   it &quot;should provide 'at' as an alias&quot; do</diff>
      <filename>spec/date_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8cd2ea3074f138582461d32580f24265d10bb47b</id>
    </parent>
  </parents>
  <author>
    <name>Yossef Mendelssohn</name>
    <email>ymendel@pobox.com</email>
  </author>
  <url>http://github.com/flogic/timely/commit/17a4b249303d1476aed6ddd36be96bed877bfb1d</url>
  <id>17a4b249303d1476aed6ddd36be96bed877bfb1d</id>
  <committed-date>2008-05-08T11:35:38-07:00</committed-date>
  <authored-date>2008-05-08T11:35:38-07:00</authored-date>
  <message>Modified Date#at_time to either take hour, minute, and second as (optional) arguments or just a single time argument.</message>
  <tree>302b7fa22a21d7efd877dbcce46d57eba9cdec8c</tree>
  <committer>
    <name>Yossef Mendelssohn</name>
    <email>ymendel@pobox.com</email>
  </committer>
</commit>
