Mailing List Archive

[no subject]
I have attached a patch that adds a $TIME dynamic variable that can be
used in Reports. It can be used to create time based reports, such as a
report of tickets opened in the past week:

SELECT p.value AS __color__,
id AS ticket, summary, component AS product, version, milestone AS
project, severity,
(CASE status WHEN 'assigned' THEN owner||' *' ELSE owner END) AS
owner,
time AS created,
changetime AS _changetime, description AS _description,
reporter AS _reporter
FROM ticket t, enum p
WHERE time > $TIME - 604800
AND p.name = t.priority AND p.type = 'priority'
ORDER BY time DESC

It's a very simple patch, and hopefully not my last contribution.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: report_time.patch
Type: application/octet-stream
Size: 441 bytes
Desc: not available
Url : /archive/trac/attachments/20040909/e7df6666/report_time.a
-------------- next part --------------



--
Paul Baker

"Yes, we did produce a near-perfect republic. But will they keep it? Or
will they, in the enjoyment of plenty, lose the memory of freedom?”
-- Thomas Jefferson in a letter to John Adams

GPG Key: http://homepage.mac.com/pauljbaker/public.asc
[no subject] [ In reply to ]
On Thu, 2004-09-09 at 20:29 -0500, Paul Baker wrote:
> I have attached a patch that adds a $TIME dynamic variable that can be
> used in Reports. It can be used to create time based reports, such as a
> report of tickets opened in the past week:

I don't believe this is necessary, since SQLite already provides a way to get the current time.

Try executing "select datetime('now');"

There's some more information on the date/time functions available here:
http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

Also, in the future I believe it's best to create a ticket on the Trac
project and attach your patch there.

--
Matthew Good <trac@matt-good.net>
[no subject] [ In reply to ]
On Sep 9, 2004, at 10:27 PM, Matthew Good wrote:
>
> I don't believe this is necessary, since SQLite already provides a way
> to get the current time.
>
> Try executing "select datetime('now');"
>
> There's some more information on the date/time functions available
> here:
> http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

Ah...I was looking at http://www.sqlite.org/lang.html and never saw any
reference to date/time related functions so I figured it was lacking.

> Also, in the future I believe it's best to create a ticket on the Trac
> project and attach your patch there.

I initially would have thought to open a ticket for it, but I was going
by the instruction "Naturally, contributions in source code form are
more than welcome. Please send patches to the MailingList for review
and merging." found on
http://projects.edgewall.com/trac/wiki/HowToContribute.

P.S. Sorry about the lack of subject. My bad.

--
Paul Baker

"Reality is that which, when you stop believing in it, doesn't go away."
-- Philip K. Dick

GPG Key: http://homepage.mac.com/pauljbaker/public.asc