<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -7,7 +7,6 @@ class Symbol
   def date_select(*args)
     Thread.current[:view_template].date_select(self, *args)
   end
-
   
   # See Mack::ViewHelpers::FormHelpers check_box for more information
   # </diff>
      <filename>lib/mack/core_extensions/symbol.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,8 @@ module Mack
         var = instance_variable_get(&quot;@#{name}&quot;)
         fe = FormElement.new(*args)
         
-        time = var.nil? ? Time.now : (var.send(fe.calling_method) || Time.now)
+        time = var if var.is_a?(Time) || var.is_a?(Date)
+        time = var.nil? ? Time.now : (var.send(fe.calling_method) || Time.now) if time.nil?
         
         years = []
         (time.year - 5).upto(time.year + 5) { |y| years &lt;&lt; [y, y]}
@@ -59,6 +60,9 @@ module Mack
         return label + boxes
       end
       
+      # Used just like date_time_select, but it has hours, minutes, and seconds turned off.
+      # 
+      # 
       def date_select(name, *args)
         fe = FormElement.new(*args)
         date_time_select(name, fe.calling_method, {:hours =&gt; false, :minutes =&gt; false, :seconds =&gt; false}.merge(fe.options))
@@ -69,6 +73,8 @@ module Mack
         options = {:name =&gt; name, :id =&gt; name}
         unless fe.calling_method == :to_s
           options.merge!(:name =&gt; &quot;#{name}[#{fe.calling_method}(#{col})]&quot;, :id =&gt; &quot;#{name}_#{fe.calling_method}_#{col}&quot;)
+        else
+          options.merge!(:name =&gt; &quot;#{name}(#{col})&quot;, :id =&gt; &quot;#{name}_#{col}&quot;)
         end
         options.merge!(:options =&gt; values, :selected =&gt; selected)
         select_tag(name, fe.options.merge(options))</diff>
      <filename>lib/mack/view_helpers/date_time_helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,6 +44,13 @@ describe Mack::ViewHelpers::FormHelpers do
   
   describe &quot;date_time_select&quot; do
     
+    it &quot;should work on a non-model time&quot; do
+      @created_at = Time.now
+      dts = date_time_select(:created_at)
+      dts.should match(/created_at\(year\)/)
+      dts.should match(/&lt;option value=&quot;#{@created_at.year}&quot; selected&gt;#{@created_at.year}&lt;\/option&gt;/)
+    end
+    
     it &quot;should generate 5 select tags by default&quot; do
       @dilbert = Dilbert.new
       @dilbert.created_at = Time.parse(&quot;2008-8-16 19:35&quot;)
@@ -96,6 +103,16 @@ describe Mack::ViewHelpers::FormHelpers do
       date_select(:dilbert, :created_at).should == date_time_select(:dilbert, :created_at, :months =&gt; true, :days =&gt; true, :hours =&gt; false, :minutes =&gt; false)
     end
     
+    it &quot;should work on a non-model time&quot; do
+      dts = date_select(:expected_date)
+      dts.should match(/expected_date\(year\)/)
+      dts.should match(/&lt;option value=&quot;2008&quot; selected&gt;2008&lt;\/option&gt;/)
+      dts.should match(/expected_date\(month\)/)
+      dts.should match(/&lt;option value=&quot;8&quot; selected&gt;August&lt;\/option&gt;/)
+      dts.should match(/expected_date\(day\)/)
+      dts.should match(/&lt;option value=&quot;24&quot; selected&gt;24&lt;\/option&gt;/)
+    end
+    
   end
   
   describe &quot;params&quot; do</diff>
      <filename>test/unit/view_helpers/date_time_helpers_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>714773dac1872c8b6dabcb5147e88ef6ac9f0f47</id>
    </parent>
  </parents>
  <author>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </author>
  <url>http://github.com/markbates/mack/commit/776c59749b58fffae02ca90cf232672cd4b6b65a</url>
  <id>776c59749b58fffae02ca90cf232672cd4b6b65a</id>
  <committed-date>2008-08-18T11:49:16-07:00</committed-date>
  <authored-date>2008-08-18T11:49:16-07:00</authored-date>
  <message>Fixed bug where date_select and date_time_select wouldn't work with 'non-models'</message>
  <tree>8b89f4a65e806bbf703ab067e8fb42c8ce99222d</tree>
  <committer>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </committer>
</commit>
