Fossil SCM
also show age of ctime and mtime in /tktview
Commit
8b48a054edda1a17f69c17984c6f409ab0e6a4f3862697fc9048e0fb000080d6
Parent
814a417b4d2d107…
2 files changed
+4
-1
+6
+4
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -191,11 +191,12 @@ | ||
| 191 | 191 | Stmt q; |
| 192 | 192 | int i, n, size, j; |
| 193 | 193 | |
| 194 | 194 | zName = PD("name","-none-"); |
| 195 | 195 | db_prepare(&q, "SELECT datetime(tkt_mtime,toLocal()) AS tkt_datetime, " |
| 196 | - "datetime(tkt_ctime,toLocal()) AS tkt_datetime_creation, *" | |
| 196 | + "datetime(tkt_ctime,toLocal()) AS tkt_datetime_creation, " | |
| 197 | + "julianday('now') - tkt_mtime, julianday('now') - tkt_ctime, *" | |
| 197 | 198 | " FROM ticket WHERE tkt_uuid GLOB '%q*'", |
| 198 | 199 | zName); |
| 199 | 200 | if( db_step(&q)==SQLITE_ROW ){ |
| 200 | 201 | n = db_column_count(&q); |
| 201 | 202 | for(i=0; i<n; i++){ |
| @@ -212,10 +213,12 @@ | ||
| 212 | 213 | }else if( memcmp(zName, "tkt_", 4)==0 && Th_Fetch(zName, &size)==0 ){ |
| 213 | 214 | Th_Store(zName, zVal); |
| 214 | 215 | } |
| 215 | 216 | free(zRevealed); |
| 216 | 217 | } |
| 218 | + Th_Store("tkt_mage", human_readable_age(db_column_double(&q, 2))); | |
| 219 | + Th_Store("tkt_cage", human_readable_age(db_column_double(&q, 3))); | |
| 217 | 220 | } |
| 218 | 221 | db_finalize(&q); |
| 219 | 222 | for(i=0; i<nField; i++){ |
| 220 | 223 | if( Th_Fetch(aField[i].zName, &size)==0 ){ |
| 221 | 224 | Th_Store(aField[i].zName, aField[i].zValue); |
| 222 | 225 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -191,11 +191,12 @@ | |
| 191 | Stmt q; |
| 192 | int i, n, size, j; |
| 193 | |
| 194 | zName = PD("name","-none-"); |
| 195 | db_prepare(&q, "SELECT datetime(tkt_mtime,toLocal()) AS tkt_datetime, " |
| 196 | "datetime(tkt_ctime,toLocal()) AS tkt_datetime_creation, *" |
| 197 | " FROM ticket WHERE tkt_uuid GLOB '%q*'", |
| 198 | zName); |
| 199 | if( db_step(&q)==SQLITE_ROW ){ |
| 200 | n = db_column_count(&q); |
| 201 | for(i=0; i<n; i++){ |
| @@ -212,10 +213,12 @@ | |
| 212 | }else if( memcmp(zName, "tkt_", 4)==0 && Th_Fetch(zName, &size)==0 ){ |
| 213 | Th_Store(zName, zVal); |
| 214 | } |
| 215 | free(zRevealed); |
| 216 | } |
| 217 | } |
| 218 | db_finalize(&q); |
| 219 | for(i=0; i<nField; i++){ |
| 220 | if( Th_Fetch(aField[i].zName, &size)==0 ){ |
| 221 | Th_Store(aField[i].zName, aField[i].zValue); |
| 222 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -191,11 +191,12 @@ | |
| 191 | Stmt q; |
| 192 | int i, n, size, j; |
| 193 | |
| 194 | zName = PD("name","-none-"); |
| 195 | db_prepare(&q, "SELECT datetime(tkt_mtime,toLocal()) AS tkt_datetime, " |
| 196 | "datetime(tkt_ctime,toLocal()) AS tkt_datetime_creation, " |
| 197 | "julianday('now') - tkt_mtime, julianday('now') - tkt_ctime, *" |
| 198 | " FROM ticket WHERE tkt_uuid GLOB '%q*'", |
| 199 | zName); |
| 200 | if( db_step(&q)==SQLITE_ROW ){ |
| 201 | n = db_column_count(&q); |
| 202 | for(i=0; i<n; i++){ |
| @@ -212,10 +213,12 @@ | |
| 213 | }else if( memcmp(zName, "tkt_", 4)==0 && Th_Fetch(zName, &size)==0 ){ |
| 214 | Th_Store(zName, zVal); |
| 215 | } |
| 216 | free(zRevealed); |
| 217 | } |
| 218 | Th_Store("tkt_mage", human_readable_age(db_column_double(&q, 2))); |
| 219 | Th_Store("tkt_cage", human_readable_age(db_column_double(&q, 3))); |
| 220 | } |
| 221 | db_finalize(&q); |
| 222 | for(i=0; i<nField; i++){ |
| 223 | if( Th_Fetch(aField[i].zName, &size)==0 ){ |
| 224 | Th_Store(aField[i].zName, aField[i].zValue); |
| 225 |
+6
| --- src/tktsetup.c | ||
| +++ src/tktsetup.c | ||
| @@ -494,16 +494,22 @@ | ||
| 494 | 494 | @ <tr><td class="tktDspLabel">Last Modified:</td><td class="tktDspValue"> |
| 495 | 495 | @ <th1> |
| 496 | 496 | @ if {[info exists tkt_datetime]} { |
| 497 | 497 | @ html $tkt_datetime |
| 498 | 498 | @ } |
| 499 | +@ if {[info exists tkt_mage]} { | |
| 500 | +@ html "<br>$tkt_mage" | |
| 501 | +@ } | |
| 499 | 502 | @ </th1> |
| 500 | 503 | @ </td> |
| 501 | 504 | @ <td class="tktDspLabel">Created:</td><td class="tktDspValue"> |
| 502 | 505 | @ <th1> |
| 503 | 506 | @ if {[info exists tkt_datetime_creation]} { |
| 504 | 507 | @ html $tkt_datetime_creation |
| 508 | +@ } | |
| 509 | +@ if {[info exists tkt_cage]} { | |
| 510 | +@ html "<br>$tkt_cage" | |
| 505 | 511 | @ } |
| 506 | 512 | @ </th1> |
| 507 | 513 | @ </td></tr> |
| 508 | 514 | @ <th1>enable_output [hascap e]</th1> |
| 509 | 515 | @ <tr> |
| 510 | 516 |
| --- src/tktsetup.c | |
| +++ src/tktsetup.c | |
| @@ -494,16 +494,22 @@ | |
| 494 | @ <tr><td class="tktDspLabel">Last Modified:</td><td class="tktDspValue"> |
| 495 | @ <th1> |
| 496 | @ if {[info exists tkt_datetime]} { |
| 497 | @ html $tkt_datetime |
| 498 | @ } |
| 499 | @ </th1> |
| 500 | @ </td> |
| 501 | @ <td class="tktDspLabel">Created:</td><td class="tktDspValue"> |
| 502 | @ <th1> |
| 503 | @ if {[info exists tkt_datetime_creation]} { |
| 504 | @ html $tkt_datetime_creation |
| 505 | @ } |
| 506 | @ </th1> |
| 507 | @ </td></tr> |
| 508 | @ <th1>enable_output [hascap e]</th1> |
| 509 | @ <tr> |
| 510 |
| --- src/tktsetup.c | |
| +++ src/tktsetup.c | |
| @@ -494,16 +494,22 @@ | |
| 494 | @ <tr><td class="tktDspLabel">Last Modified:</td><td class="tktDspValue"> |
| 495 | @ <th1> |
| 496 | @ if {[info exists tkt_datetime]} { |
| 497 | @ html $tkt_datetime |
| 498 | @ } |
| 499 | @ if {[info exists tkt_mage]} { |
| 500 | @ html "<br>$tkt_mage" |
| 501 | @ } |
| 502 | @ </th1> |
| 503 | @ </td> |
| 504 | @ <td class="tktDspLabel">Created:</td><td class="tktDspValue"> |
| 505 | @ <th1> |
| 506 | @ if {[info exists tkt_datetime_creation]} { |
| 507 | @ html $tkt_datetime_creation |
| 508 | @ } |
| 509 | @ if {[info exists tkt_cage]} { |
| 510 | @ html "<br>$tkt_cage" |
| 511 | @ } |
| 512 | @ </th1> |
| 513 | @ </td></tr> |
| 514 | @ <th1>enable_output [hascap e]</th1> |
| 515 | @ <tr> |
| 516 |