Project

General

Profile

Actions

Feature #1885

closed

Change Start from date to datetime

Feature #1885: Change Start from date to datetime

Added by Stacy Mader about 18 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Time tracking
Target version:
-
Resolution:
Duplicate

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 1 (1 open — 0 closed)

Is duplicate of Redmine - Feature #5458: Extend Start/Due date to include timeNewActions

Updated by Stacy Mader about 18 years ago Actions #1

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 18 years ago Actions #2

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 18 years ago Actions #3

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 18 years ago Actions #4

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 18 years ago Actions #5

I've fixed the problem I wrote above. Simply modify due_date column to be datetime =)

Updated by Stacy Mader about 18 years ago Actions #6

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 18 years ago Actions #7

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 18 years ago Actions #8

Is useful to have redmine automatically calculate the estimate time.

Updated by rafael mascayano about 17 years ago Actions #9

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 Dipan Mehta over 13 years ago Actions #10

Add related #11044.

Updated by Toshi MARUYAMA over 12 years ago Actions #11

  • Status changed from New to Closed
  • Resolution set to Duplicate

I close as duplicate of #5458.
#5458 has more discussion.

Updated by Toshi MARUYAMA over 12 years ago Actions #12

  • Related to deleted (Feature #11044: Custom field types for time and datetime)

Updated by Toshi MARUYAMA over 12 years ago Actions #13

  • Is duplicate of Feature #5458: Extend Start/Due date to include time added
Actions

Also available in: PDF Atom