Yes, in ruby when I type Date.today I get this:
#<Date: 4910111/2,0,2299161>
Here's the code that attempts to retrieve the gantt information (from
issues_controller.rb in redmine):
def gantt
@gantt = Redmine::Helpers::Gantt.new(params)
retrieve_query
if @query.valid?
events = []
# Issues that have start and due dates
events += Issue.find(:all,
:order => "start_date, due_date",
:include =>
[:tracker, :status, :assigned_to, :priority, :project],
:conditions => ["(#{@query.statement}) AND
(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?)
or (start_date<? and due_date>?)) and start_date is not null and
due_date is not null)", @gantt.date_from, @gantt.date_to,
@gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to]
)
# Issues that don't have a due date but that are assigned to a
version with a date
events += Issue.find(:all,
:order => "start_date, effective_date",
:include =>
[:tracker, :status, :assigned_to, :priority, :project, :fixed_version],
:conditions => ["(#{@query.statement}) AND
(((start_date>=? and start_date<=?) or (effective_date>=? and
effective_date<=?) or (start_date<? and effective_date>?)) and
start_date is not null and due_date is null and effective_date is not
null)", @gantt.date_from, @gantt.date_to, @gantt.date_from,
@gantt.date_to, @gantt.date_from, @gantt.date_to]
)
# Versions
events += Version.find(:all, :include => :project,
:conditions => ["(#
{@query.project_statement}) AND effective_date BETWEEN ? AND ?",
@gantt.date_from, @gantt.date_to])
@gantt.events = events
end
When looking at your adapter I see that there is this code to coerce
datetime to date or time:
def simplified_datetime
if table_klass &&
table_klass.coerced_sqlserver_date_columns.include?(name)
:date
elsif table_klass &&
table_klass.coerced_sqlserver_time_columns.include?(name)
:time
else
:datetime
end
end
Also UDT means user defined type(s)--not sure if this is the proper
acronym, but it seems to make sense :P