<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -32,14 +32,14 @@ module CollectiveIdea
         #
         # MySQL treats BETWEEN() strangely with dates, so we don't use it.
         named_scope :in_date_range, lambda{|range|
-          range ||= (Date.today..Date.today)
+          range ||= (Time.zone.today..Time.zone.today)
           {:conditions =&gt; [&quot;
             #{quoted_table_name}.#{quoted_end_at_column_name} &gt;= :begin_at AND (
               (#{quoted_table_name}.#{quoted_begin_at_column_name} &lt;= :begin_at AND :begin_at &lt;= #{quoted_table_name}.#{quoted_end_at_column_name}) 
                 OR (#{quoted_table_name}.#{quoted_begin_at_column_name} &gt;= :begin_at AND :end_at &gt;= #{quoted_table_name}.#{quoted_begin_at_column_name} )
             )&quot;, {
-            :begin_at =&gt; range.first.beginning_of_day, 
-            :end_at =&gt; range.last.end_of_day}]}
+            :begin_at =&gt; range.first.beginning_of_day.in_time_zone, 
+            :end_at =&gt; range.last.end_of_day.in_time_zone}]}
         }
 
         named_scope :upcoming, lambda{ {:conditions =&gt; [&quot;#{quoted_table_name}.#{quoted_end_at_column_name} &gt; ?&quot;, Time.now]} }
@@ -49,7 +49,7 @@ module CollectiveIdea
         # This will find those dates too.
         # FIXME: Don't assume weeks start on Monday.
         scope_chain(:in_month_with_outliers) do |chain, *args|
-          date = (args.shift || Date.today).to_date
+          date = (args.shift || Time.zone.today).to_date
           start = date.beginning_of_month.beginning_of_week - 1
           stop = date.end_of_month.next_week.beginning_of_week - 2
           chain.in_date_range(start..stop)
@@ -57,17 +57,17 @@ module CollectiveIdea
         
         scope_chain(:on_date) do |chain, *args|
           # we call date.to_date to ensure it is an instance of Date
-          date = (args.shift || Date.today).to_date
+          date = (args.shift || Time.zone.today).to_date
           chain.in_date_range(date..date)
         end
         
         scope_chain(:in_month) do |chain, *args|
-          date = (args.shift || Date.today).to_date
+          date = (args.shift || Time.zone.today).to_date
           chain.in_date_range(date.beginning_of_month..date.end_of_month)
         end
         
         scope_chain(:in_rolling_month) do |chain, *args|
-          date = (args.shift || Date.today).to_date
+          date = (args.shift || Time.zone.today).to_date
           number_of_weeks = (args.shift || 4)
           beginning = date.beginning_of_week - 1
           ending = (beginning + number_of_weeks.weeks).</diff>
      <filename>lib/active_record/event_finders.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>056102dad778cfd83d75ab88b139df2900aff199</id>
    </parent>
  </parents>
  <author>
    <name>Daniel Morrison</name>
    <email>daniel@collectiveidea.com</email>
  </author>
  <url>http://github.com/collectiveidea/calendar_builder/commit/b9df1622fbf4952efc626888aec77847b6fe8dd8</url>
  <id>b9df1622fbf4952efc626888aec77847b6fe8dd8</id>
  <committed-date>2009-09-30T08:14:24-07:00</committed-date>
  <authored-date>2009-09-30T08:14:24-07:00</authored-date>
  <message>Respect time zones.</message>
  <tree>0653e1796c341b7b33ef2757ee6f6d496ab41c0a</tree>
  <committer>
    <name>Daniel Morrison</name>
    <email>daniel@collectiveidea.com</email>
  </committer>
</commit>
