Edgewall Software

Ticket #2257 (closed enhancement: worksforme)

Opened 3 years ago

Last modified 3 years ago

Provide magic $NOW value to reports

Reported by: fumanchu@… Owned by: daniel
Priority: normal Milestone:
Component: report system Version: devel
Severity: normal Keywords:
Cc:

Description

I've added the $NOW magic variable to my reports:

# inside trac/ticket/report.py

        if not report_args.has_key('USER'):
            report_args['USER'] = req.authname
+         if not report_args.has_key('NOW'):
+             report_args['NOW'] = str(int(time.time()))

It's nice when making reports that show how long tickets have been open, using ($NOW - ticket.time) / 3600 to show hours.

Attachments

Change History

Changed 3 years ago by anonymous

  • type changed from defect to enhancement

Sorry, should have been an enhancement.

Changed 3 years ago by mgood

  • status changed from new to closed
  • resolution set to worksforme

Date computations compared to the current time can already be done with the database's built-in date and time methods. For SQLite see http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

So for example to get the number of days a ticket has been open:

select julianday('now') - julianday(time, 'unixepoch') from ticket

Add/Change #2257 (Provide magic $NOW value to reports)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from daniel. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.