DateTime => Time for consistency in changeset code, ok by shaun.

This commit is contained in:
Thomas Wood 2008-12-31 16:33:02 +00:00
parent 8fe53e4823
commit 898beb7b7f
5 changed files with 9 additions and 9 deletions

View file

@ -8,7 +8,7 @@ class BrowseController < ApplicationController
end
def index
@changesets = Changeset.find(:all, :order => "closed_at DESC", :conditions => ['closed_at < ?', DateTime.now], :limit=> 20)
@changesets = Changeset.find(:all, :order => "closed_at DESC", :conditions => ['closed_at < ?', Time.now], :limit=> 20)
end
def relation

View file

@ -376,11 +376,11 @@ private
times = time.split(/,/)
raise OSM::APIBadUserInput.new("bad time range") if times.size != 2
from, to = times.collect { |t| DateTime.parse(t) }
from, to = times.collect { |t| Time.parse(t) }
return ['closed_at >= ? and created_at <= ?', from, to]
else
# if there is no comma, assume its a lower limit on time
return ['closed_at >= ?', DateTime.parse(time)]
return ['closed_at >= ?', Time.parse(time)]
end
else
return nil
@ -396,7 +396,7 @@ private
##
# restrict changes to those which are open
def conditions_open(open)
return open.nil? ? nil : ['closed_at >= ?', DateTime.now]
return open.nil? ? nil : ['closed_at >= ?', Time.now]
end
end

View file

@ -5,7 +5,7 @@
#<%= changeset.id %>
<td class="<%= cl %>">
<% if changeset.closed_at > DateTime.now %> (still editing)
<% if changeset.closed_at > Time.now %> (still editing)
<% else %><%= changeset.closed_at.strftime("%d %b %Y %H:%M") %><% end %>
<td class="<%= cl %>">