Opened 18 years ago
Closed 18 years ago
#4158 closed defect (fixed)
[PATCH] - Display DateTime values in Query Results correctly
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | report system | Version: | devel |
Severity: | minor | Keywords: | datetime |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
the patch enables the dispaly of 'time' and 'changetime' fields (if available), otherwise the behaviour remains the same:
It is identical to the patch suggested by mgood within this thread
See line 140 of this patch
Attachments (0)
Change History (6)
follow-ups: 2 6 comment:1 by , 18 years ago
Keywords: | datetime added |
---|---|
Milestone: | → 0.11 |
Owner: | changed from | to
Severity: | normal → minor |
comment:2 by , 18 years ago
Replying to cboos:
Thanks, though it looks preferable to do that based on type of the column.
…which is not yet defined.
I've 'back-developed' my patches to not affect the ticket api (as suggested by mgood):
http://groups.google.com/group/trac-dev/msg/61c2134c408c1296
So, at this point the field type definition does not exist thus looking for 'datetime' would not work. The suggested patch does the work fine (until the fields api is refactored/extended).
-
templates/query_div.html
48 48 <td py:when="idx == 0" class="id"><a href="$result.href" title="View ticket">#$result.id</a></td> 49 49 <td py:otherwise="" class="$header.name" py:choose=""> 50 50 <a py:when="header.name == 'summary'" href="$result.href" title="View ticket">$result.summary</a> 51 <span py:when="header.name in ('time', 'changetime')">${format_datetime(result[header.name])}</span> 51 52 <span py:otherwise="">${result[header.name]}</span> 52 53 </td> 53 54 </py:for>
follow-up: 4 comment:3 by , 18 years ago
Note that I've checked directly the type of the value: isinstance(value, datetime)
comment:4 by , 18 years ago
Replying to cboos:
Note that I've checked directly the type of the value:
isinstance(value, datetime)
Oh yes, I see (a little bit overworked).
This would be a more elegant generic solution.
Of course it should be prefered.
comment:5 by , 18 years ago
I've applied the patch and it works fine on the server, so for me it fine if it goes in trunk this way.
Thanks, though it looks preferable to do that based on type of the column.
query_div.html