<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>History.txt</filename>
    </added>
    <added>
      <filename>Manifest.txt</filename>
    </added>
    <added>
      <filename>Readme.txt</filename>
    </added>
    <added>
      <filename>calendar_date_select.gemspec</filename>
    </added>
    <added>
      <filename>lib/calendar_date_select/calendar_date_select.rb</filename>
    </added>
    <added>
      <filename>lib/calendar_date_select/includes_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,24 +1,31 @@
-require 'echoe'
-# try &quot;rake -T&quot; so see the wunderfull tasks generated by the little code below ;-)
+# -*- ruby -*-
 
-Echoe.new(&quot;timcharper-calendar_date_select&quot;) do |p|
-  p.version = &quot;1.11.1&quot;
-  p.author = &quot;Tim Harper&quot;
-  p.email = &quot;timcharper@gmail.com&quot;
-  p.url = &quot;http://github.com/timcharper/calendar_date_select&quot;
-  p.summary = &quot;A popular and flexible JavaScript DatePicker for RubyOnRails&quot;
-  p.description = &lt;&lt;-END_OF_DESCRIPTION
-    CalendarDateSelect is semi-light-weight and easy to use!
-    It takes full advantage of the prototype.js library, resulting in less code,
-    but maintaining a great deal of functionality.
-    Project site: http://code.google.com/p/calendardateselect/
-    END_OF_DESCRIPTION
-  p.has_rdoc = false
-  p.platform = Gem::Platform::RUBY 
-  p.ignore_pattern = Dir.glob(&quot;{tmp}/**/*&quot;)
-  p.test_files = [
-    &quot;test/test_helper.rb&quot;,
-    &quot;test/functional/calendar_date_select_test.rb&quot;,
-    &quot;test/functional/helper_methods_test.rb&quot;
-    ]
+require 'rubygems'
+require 'hoe'
+
+$: &lt;&lt; File.dirname(__FILE__) + &quot;/lib/&quot;
+require &quot;activesupport&quot;
+require './lib/calendar_date_select.rb'
+
+Hoe.new('calendar_date_select', CalendarDateSelect::VERSION) do |p|
+  p.rubyforge_name = 'calendar_date_select'
+  p.developer('Tim Harper', 'tim c harper at gmail dot com')
+end
+
+
+task :set_version do
+  [&quot;lib/calendar_date_select/calendar_date_select.rb&quot;, &quot;public/javascripts/calendar_date_select/calendar_date_select.js&quot;].each do |file|
+    abs_file = File.dirname(__FILE__) + &quot;/&quot; + file
+    src = File.read(abs_file);
+    src = src.map do |line|
+      case line
+      when /^ *VERSION/                        then &quot;  VERSION = '#{ENV['VERSION']}'\n&quot;
+      when /^\/\/ CalendarDateSelect version / then &quot;// CalendarDateSelect version #{ENV['VERSION']} - a prototype based date picker\n&quot;
+      else
+        line
+      end
+    end.join
+    File.open(abs_file, &quot;wb&quot;) { |f| f &lt;&lt; src }
+  end
 end
+# vim: syntax=Ruby</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1 @@
-%w[calendar_date_select includes_helper].each { |file| 
-  require File.join( File.dirname(__FILE__), &quot;lib&quot;,file) 
-}
-
-ActionView::Helpers::FormHelper.send(:include, CalendarDateSelect::FormHelper)
-ActionView::Base.send(:include, CalendarDateSelect::FormHelper)
-ActionView::Base.send(:include, CalendarDateSelect::IncludesHelper)
-
-# install files
-unless File.exists?(RAILS_ROOT + '/public/javascripts/calendar_date_select/calendar_date_select.js')
-  ['/public', '/public/javascripts/calendar_date_select', '/public/stylesheets/calendar_date_select', '/public/images/calendar_date_select', '/public/javascripts/calendar_date_select/locale'].each do |dir|
-    source = File.join(File.dirname(__FILE__), dir)
-    dest = RAILS_ROOT + dir
-    FileUtils.mkdir_p(dest)
-    FileUtils.cp(Dir.glob(source+'/*.*'), dest)
-  end
-end
+require File.dirname(__FILE__) + &quot;/lib/calendar_date_select.rb&quot;</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,222 +1,19 @@
-class CalendarDateSelect
-  FORMATS = {
-    :natural =&gt; {
-      :date =&gt; &quot;%B %d, %Y&quot;,
-      :time =&gt; &quot; %I:%M %p&quot;
-    },
-    :hyphen_ampm =&gt; {
-      :date =&gt; &quot;%Y-%m-%d&quot;,
-      :time =&gt; &quot; %I:%M %p&quot;,
-      :javascript_include =&gt; &quot;format_hyphen_ampm&quot;
-    },
-    :iso_date =&gt; {
-      :date =&gt; &quot;%Y-%m-%d&quot;, 
-      :time =&gt; &quot; %H:%M&quot;,
-      :javascript_include =&gt; &quot;format_iso_date&quot;
-    }, 
-    :finnish =&gt; {
-      :date =&gt; &quot;%d.%m.%Y&quot;,
-      :time =&gt; &quot; %H:%M&quot;,
-      :javascript_include =&gt; &quot;format_finnish&quot;
-    },
-    :american =&gt; {
-      :date =&gt; &quot;%m/%d/%Y&quot;,
-      :time =&gt; &quot; %I:%M %p&quot;,
-      :javascript_include =&gt; &quot;format_american&quot;
-    },
-    :euro_24hr =&gt; {
-      :date =&gt; &quot;%d %B %Y&quot;,
-      :time =&gt; &quot; %H:%M&quot;, 
-      :javascript_include =&gt; &quot;format_euro_24hr&quot;
-    },
-    :euro_24hr_ymd =&gt; {
-      :date =&gt; &quot;%Y.%m.%d&quot;,
-      :time =&gt; &quot; %H:%M&quot;, 
-      :javascript_include =&gt; &quot;format_euro_24hr_ymd&quot;
-    },
-    :italian =&gt; {
-      :date =&gt; &quot;%d/%m/%Y&quot;,
-      :time =&gt; &quot; %H:%M&quot;,
-      :javascript_include =&gt; &quot;format_italian&quot;
-    },
-    :db =&gt; {
-      :date =&gt; &quot;%Y-%m-%d&quot;,
-      :time =&gt; &quot;%H:%M&quot;,
-      :javascript_include =&gt; &quot;format_db&quot;
-    }
-  }
-  
-  cattr_accessor :image
-  @@image = &quot;calendar_date_select/calendar.gif&quot;
-  
-  cattr_reader :format
-  @@format = FORMATS[:natural]
-  
-  class &lt;&lt; self
-    def format=(format)
-      raise &quot;CalendarDateSelect: Unrecognized format specification: #{format}&quot; unless FORMATS.has_key?(format)
-      @@format = FORMATS[format]
-    end
-    
-    def javascript_format_include
-      @@format[:javascript_include] &amp;&amp; &quot;calendar_date_select/#{@@format[:javascript_include]}&quot;
-    end
-    
-    def date_format_string(time=false)
-      @@format[:date] + ( time ? @@format[:time] : &quot;&quot; )
-    end
-    
-    def format_date(date)
-      if Date===date
-        date.strftime(date_format_string(false))
-      else
-        date.strftime(date_format_string(true))
-      end
-    end
-    
-    def has_time?(value)
-      /[0-9]:[0-9]{2}/.match(value.to_s)
-    end
-  end
-  
-  module FormHelper
-    def calendar_date_select_tag( name, value = nil, options = {})
-      calendar_options = calendar_date_select_process_options(options)
-      value = format_time(value, calendar_options)
-      
-      calendar_options.delete(:format)
-      
-      options[:id] ||= name
-      tag = calendar_options[:hidden] || calendar_options[:embedded] ? 
-        hidden_field_tag(name, value, options) :
-        text_field_tag(name, value, options)
-      
-      calendar_date_select_output(tag, calendar_options)
-    end
-    
-    def format_time(value, options = {})
-      if value.respond_to?(&quot;strftime&quot;)
-        if options[:format]
-          value = value.strftime(options[:format])
-        else
-          if options.has_key? :time
-            value = value.strftime(CalendarDateSelect.date_format_string(options[:time]))
-          else
-            value = CalendarDateSelect.format_date(value)
-          end
-        end
-      end
-      value
-   end
-    
-    # extracts any options passed into calendar date select, appropriating them to either the Javascript call or the html tag.
-    def calendar_date_select_process_options(options)
-      calendar_options = {}
-      callbacks = [:before_show, :before_close, :after_show, :after_close, :after_navigate]
-      for key in [:time, :valid_date_check, :embedded, :buttons, :clear_button, :format, :year_range, :month_year, :popup, :hidden, :minute_interval] + callbacks
-        calendar_options[key] = options.delete(key) if options.has_key?(key)
-      end
-      
-      # if passing in mixed, pad it with single quotes
-      calendar_options[:time] = &quot;'mixed'&quot; if calendar_options[:time].to_s==&quot;mixed&quot;
-      calendar_options[:month_year] = &quot;'#{calendar_options[:month_year]}'&quot; if calendar_options[:month_year]
-      
-      # if we are forcing the popup, automatically set the readonly property on the input control.
-      if calendar_options[:popup].to_s == &quot;force&quot;
-        calendar_options[:popup] = &quot;'force'&quot;
-        options[:readonly] = true 
-      end
-      
-      if (vdc=calendar_options.delete(:valid_date_check))
-        if vdc.include?(&quot;;&quot;) || vdc.include?(&quot;function&quot;)
-          throw &quot;:valid_date_check function is missing a 'return' statement.  Try something like: :valid_date_check =&gt; 'if (date &gt; new(Date)) return true; else return false;'&quot; unless vdc.include?(&quot;return&quot;);
-        end
-        
-        vdc = &quot;return(#{vdc})&quot; unless vdc.include?(&quot;return&quot;)
-        vdc = &quot;function(date) { #{vdc} }&quot; unless vdc.include?(&quot;function&quot;)
-        calendar_options[:valid_date_check] = vdc
-      end
-      
-      calendar_options[:popup_by] ||= &quot;this&quot; if calendar_options[:hidden]
-      
-      # surround any callbacks with a function, if not already done so
-      for key in callbacks
-        calendar_options[key] = &quot;function(param) { #{calendar_options[key]} }&quot; unless calendar_options[key].include?(&quot;function&quot;) if calendar_options[key]
-      end
-      
-      calendar_options[:year_range] = format_year_range(calendar_options[:year_range] || 10)
-      calendar_options
-    end
-    
-    def calendar_date_select(object, method, options={})
-      obj = options[:object] || instance_variable_get(&quot;@#{object}&quot;)
-      
-      if !options.include?(:time) &amp;&amp; obj.class.respond_to?(&quot;columns_hash&quot;)
-        column_type = (obj.class.columns_hash[method.to_s].type rescue nil)
-        options[:time] = true if column_type == :datetime
-      end
-      
-      use_time = options[:time]
-      
-      if options[:time].to_s==&quot;mixed&quot;
-        use_time = false if Date===(obj.respond_to?(method) &amp;&amp; obj.send(method))
-      end
-      
-      calendar_options = calendar_date_select_process_options(options)
-      
-      options[:value] ||= 
-        if(obj.respond_to?(method) &amp;&amp; obj.send(method).respond_to?(:strftime))
-          obj.send(method).strftime(CalendarDateSelect.date_format_string(use_time))
-        elsif obj.respond_to?(&quot;#{method}_before_type_cast&quot;) 
-          obj.send(&quot;#{method}_before_type_cast&quot;)
-        elsif obj.respond_to?(method)
-          obj.send(method).to_s
-        else
-          nil
-        end
-
-      tag = ActionView::Helpers::InstanceTag.new(object, method, self, nil, options.delete(:object))
-      calendar_date_select_output(
-        tag.to_input_field_tag( (calendar_options[:hidden] || calendar_options[:embedded]) ? &quot;hidden&quot; : &quot;text&quot;, options), 
-        calendar_options
-      )
-    end  
-    
-    def calendar_date_select_output(input, calendar_options = {})
-      out = input
-      if calendar_options[:embedded]
-        uniq_id = &quot;cds_placeholder_#{(rand*100000).to_i}&quot;
-        # we need to be able to locate the target input element, so lets stick an invisible span tag here we can easily locate
-        out &lt;&lt; content_tag(:span, nil, :style =&gt; &quot;display: none; position: absolute;&quot;, :id =&gt; uniq_id)
-        
-        out &lt;&lt; javascript_tag(&quot;new CalendarDateSelect( $('#{uniq_id}').previous(), #{options_for_javascript(calendar_options)} ); &quot;)
-      else
-        out &lt;&lt; &quot; &quot;
-        
-        out &lt;&lt; image_tag(CalendarDateSelect.image, 
-            :onclick =&gt; &quot;new CalendarDateSelect( $(this).previous(), #{options_for_javascript(calendar_options)} );&quot;,
-            :style =&gt; 'border:0px; cursor:pointer;')
-      end
-      
-      out
-    end
-    
-  private
-    def format_year_range(year) # nodoc
-      return year unless year.respond_to?(:first)
-      return &quot;[#{year.first}, #{year.last}]&quot; unless year.first.respond_to?(:strftime)
-      return &quot;[#{year.first.year}, #{year.last.year}]&quot;
-    end
-  end
-end
-
-
-module ActionView
-  module Helpers
-    class FormBuilder
-      def calendar_date_select(method, options = {})
-        @template.calendar_date_select(@object_name, method, options.merge(:object =&gt; @object))
-      end
-    end
-  end
-end
+require &quot;calendar_date_select/calendar_date_select.rb&quot;
+require &quot;calendar_date_select/includes_helper.rb&quot;
+
+if Object.const_defined?(:Rails) &amp;&amp; File.directory?(Rails.root + &quot;/public&quot;)
+  ActionView::Helpers::FormHelper.send(:include, CalendarDateSelect::FormHelper)
+  ActionView::Base.send(:include, CalendarDateSelect::FormHelper)
+  ActionView::Base.send(:include, CalendarDateSelect::IncludesHelper)
+
+  # install files
+  unless File.exists?(RAILS_ROOT + '/public/javascripts/calendar_date_select/calendar_date_select.js')
+    ['/public', '/public/javascripts/calendar_date_select', '/public/stylesheets/calendar_date_select', '/public/images/calendar_date_select', '/public/javascripts/calendar_date_select/locale'].each do |dir|
+      source = File.dirname(__FILE__) + &quot;/../#{dir}&quot;
+      dest = RAILS_ROOT + dir
+      FileUtils.mkdir_p(dest)
+      FileUtils.cp(Dir.glob(source+'/*.*'), dest)
+    end
+  end
+
+end
\ No newline at end of file</diff>
      <filename>lib/calendar_date_select.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,36 +1,36 @@
-Date.prototype.toFormattedString = function(include_time){
-  str = this.getFullYear() + &quot;-&quot; + Date.padded2(this.getMonth() + 1) + &quot;-&quot; +Date.padded2(this.getDate()); 
-
-if (include_time) { hour=this.getHours(); str += &quot; &quot; + this.getAMPMHour() + &quot;:&quot; + this.getPaddedMinutes() + &quot; &quot; + this.getAMPM() }
-return str;
-}
-
-Date.parseFormattedString = function (string) {
-  var regexp = &quot;([0-9]{4})(-([0-9]{2})(-([0-9]{2})&quot; +
-      &quot;( ([0-9]{1,2}):([0-9]{2})? *(pm|am)&quot; +
-      &quot;?)?)?)?&quot;;
-  var d = string.match(new RegExp(regexp, &quot;i&quot;));
-  if (d==null) return Date.parse(string); // at least give javascript a crack at it.
-  var offset = 0;
-  var date = new Date(d[1], 0, 1);
-  if (d[3]) { date.setMonth(d[3] - 1); }
-  if (d[5]) { date.setDate(d[5]); }
-  if (d[7]) {
-    hours = parseInt(d[7], 10);
-    offset=0;
-    is_pm = (d[9].toLowerCase()==&quot;pm&quot;)
-    if (is_pm &amp;&amp; hours &lt;= 11) hours+=12;
-    if (!is_pm &amp;&amp; hours == 12) hours=0;
-    date.setHours(hours); 
-    
-  }
-  if (d[8]) { date.setMinutes(d[8]); }
-  if (d[10]) { date.setSeconds(d[10]); }
-  if (d[12]) { date.setMilliseconds(Number(&quot;0.&quot; + d[12]) * 1000); }
-  if (d[14]) {
-      offset = (Number(d[16]) * 60) + Number(d[17]);
-      offset *= ((d[15] == '-') ? 1 : -1);
-  }
-
-  return date;
+Date.prototype.toFormattedString = function(include_time){
+  str = this.getFullYear() + &quot;-&quot; + Date.padded2(this.getMonth() + 1) + &quot;-&quot; +Date.padded2(this.getDate()); 
+
+if (include_time) { hour=this.getHours(); str += &quot; &quot; + this.getAMPMHour() + &quot;:&quot; + this.getPaddedMinutes() + &quot; &quot; + this.getAMPM() }
+return str;
+}
+
+Date.parseFormattedString = function (string) {
+  var regexp = &quot;([0-9]{4})(-([0-9]{2})(-([0-9]{2})&quot; +
+      &quot;( ([0-9]{1,2}):([0-9]{2})? *(pm|am)&quot; +
+      &quot;?)?)?)?&quot;;
+  var d = string.match(new RegExp(regexp, &quot;i&quot;));
+  if (d==null) return Date.parse(string); // at least give javascript a crack at it.
+  var offset = 0;
+  var date = new Date(d[1], 0, 1);
+  if (d[3]) { date.setMonth(d[3] - 1); }
+  if (d[5]) { date.setDate(d[5]); }
+  if (d[7]) {
+    hours = parseInt(d[7], 10);
+    offset=0;
+    is_pm = (d[9].toLowerCase()==&quot;pm&quot;)
+    if (is_pm &amp;&amp; hours &lt;= 11) hours+=12;
+    if (!is_pm &amp;&amp; hours == 12) hours=0;
+    date.setHours(hours); 
+    
+  }
+  if (d[8]) { date.setMinutes(d[8]); }
+  if (d[10]) { date.setSeconds(d[10]); }
+  if (d[12]) { date.setMilliseconds(Number(&quot;0.&quot; + d[12]) * 1000); }
+  if (d[14]) {
+      offset = (Number(d[16]) * 60) + Number(d[17]);
+      offset *= ((d[15] == '-') ? 1 : -1);
+  }
+
+  return date;
 }
\ No newline at end of file</diff>
      <filename>public/javascripts/calendar_date_select/format_hyphen_ampm.js</filename>
    </modified>
    <modified>
      <diff>@@ -9,15 +9,8 @@ require 'action_view'
 
 require 'ostruct'
 
-for file in [&quot;../lib/calendar_date_select.rb&quot;, &quot;../lib/includes_helper.rb&quot;]
-  require File.expand_path(File.join(File.dirname(__FILE__), file))
-end
-
-def dbg
-  require 'ruby-debug'
-  Debugger.start
-  debugger
-end
+$: &lt;&lt; (File.dirname(__FILE__) + &quot;/../lib&quot;)
+require &quot;calendar_date_select&quot;
 
 class Object
   def to_regexp</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>CHANGELOG</filename>
    </removed>
    <removed>
      <filename>README.textile</filename>
    </removed>
    <removed>
      <filename>lib/gem_init.rb</filename>
    </removed>
    <removed>
      <filename>lib/includes_helper.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>6ec4ecb6add6e5d6f303be6f30842cec835ae4bb</id>
    </parent>
  </parents>
  <author>
    <name>Tim Harper</name>
    <email>timcharper@gmail.com</email>
  </author>
  <url>http://github.com/edwinmoss/calendar_date_select/commit/f31736821bf21dfeaf46ccaaa87e2373fda10644</url>
  <id>f31736821bf21dfeaf46ccaaa87e2373fda10644</id>
  <committed-date>2008-11-22T23:08:34-08:00</committed-date>
  <authored-date>2008-11-22T22:51:22-08:00</authored-date>
  <message>Cleaning up to prepare for ruby-forge release

Got rid of all dos line endings (ugh.. I hate those things)
Refactored directory structure to get ready for Hoe transition
Rake helper to set the version (in javascript and in ruby)</message>
  <tree>8c34feebbd47c1372c5b32d8fe428b29e23047f2</tree>
  <committer>
    <name>Tim Harper</name>
    <email>timcharper@gmail.com</email>
  </committer>
</commit>
