Feature #1885
closedChange Start from date to datetime
0%
Description
For software bug tracking, it is sometimes good to know the time when the event occurred, so one can verify against log files. The default column descriptor for Start (start_date) is date, but it would be a nice feature to enable this to datetime.
If this is not possible, it would be good to hide Start on the issue form (c.f. issue 1296).
Cheers.
Redmine 0.7.3.1787 (MySQL)
Ruby 1.8.5
Rails 2.0.2
Related issues
Updated by Stacy Mader about 16 years ago
Finishing of the last sentence :)
If this is not possible, it would be good to hide Start on the issue form (c.f. issue 1296) and define a new field. Unfortunately it does not look like datetime is avaiable for creating custom fields.
Updated by Dmitry Shur about 16 years ago
Hi!
I've met the same problem yesterday.
Here's solution - alter table issues in DB (change type for start_date from date to datetime)
Then change some stuff in code.
find in {redmine_dir}/app/views/issues/show.rhtml: <td style="width:15%"><b><%=l(:field_start_date)%> :</b></td><td style="width:35%"><%= format_date(@issue.start_date) %></td>
and change it to
{redmine_dir}/app/views/issues/show.rhtml: <_td style="width:15%"><b><%=l(:field_start_date)%> :</b></td><td style="width:35%"><%=
format_datetime(@issue.start_date) %></td>_
In file {redmine_dir}/app/helpers/application_helper.rb add method
def format_datetime(date)
return nil unless date
date.strftime("%Y-%m-%d %H-%M-%S")
end
Updated by Stacy Mader about 16 years ago
Many thanks! I updated the ISSUES table using the following:
mysql> alter table issues modify column field datetime;
Also, I made the changes you mention, however once I restart MySQL and Redmine, I still see only the date on the New issue form - the time is not present.
Cheers,
Stacy.
Updated by Dmitry Shur about 16 years ago
Stacy, I'm not sure that you've altered table in the right way
I've did it next way - "alter table issues modify start_date datetime;"
Also, I've found out that I've misprinted at my previous note:
instead of _def format_datetime(date) should be def format_datetime(date)
I've faced some problem with updating issues after applying this changes. I haven't investigated yet, where is the problem, hope I'll have enough time in next couple of days. Anyway, I've made some more imporvements, hope that you won't face bug with updating
Updated by Dmitry Shur about 16 years ago
I've fixed the problem I wrote above. Simply modify due_date column to be datetime =)
Updated by Stacy Mader about 16 years ago
Thanks. Sadly I still only see the date in the Start field. I'm thinking it might be an issue with the javascript calender?
Updated by Dmitry Shur about 16 years ago
Well, and did you try to add time at that field manually?
How it works at my instance - I'm adding new issues/updating existing - field start date is filled in only with current date. Then I'm adding time and save. After that I can see Start filled with date+time
Updated by Riccardo Delpopolo almost 16 years ago
Is useful to have redmine automatically calculate the estimate time.
Updated by rafael mascayano about 15 years ago
Riccardo Delpopolo wrote:
Is useful to have redmine automatically calculate the estimate time.
I've installed version 0.8.4. I made the changes and success. The problem was when I tried to see gantt and calendar visualization. The first one , I replace:
i_start_date = (i.start_date >= @gantt.date_from ? i.start_date : @gantt.date_from )
i_end_date = (i.due_before <= @gantt.date_to ? i.due_before : @gantt.date_to )
for
i_end_date = (i.due_before <= @gantt.date_to ? i.due_before : @gantt.date_to )
i_start_date = Date.parse(format_date(i_start_date))
i_end_date = Date.parse(format_date(i_end_date))
Then I change
i_done_date = i.start_date + ((i.due_before - i.start_date+1)*i.done_ratio/100).floor
i_done_date = (i_done_date <= @gantt.date_from ? @gantt.date_from : i_done_date )
i_done_date = (i_done_date >= @gantt.date_to ? @gantt.date_to : i_done_date )
for
i_done_date = i.start_date + ((i.due_before - i.start_date+1)*i.done_ratio/100).floor
i_done_date = (i_done_date <= @gantt.date_from ? @gantt.date_from : i_done_date )
i_done_date = (i_done_date >= @gantt.date_to ? @gantt.date_to : i_done_date )
i_done_date = Date.parse(format_date(i_done_date))
I still have problems with calendar, because it didn't display issues.
Updated by Toshi MARUYAMA over 10 years ago
- Status changed from New to Closed
- Resolution set to Duplicate
Updated by Toshi MARUYAMA over 10 years ago
- Related to deleted (Feature #11044: Custom field types for time and datetime)
Updated by Toshi MARUYAMA over 10 years ago
- Is duplicate of Feature #5458: Extend Start/Due date to include time added