aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordave%intrec.com <>2001-01-25 13:08:21 +0000
committerdave%intrec.com <>2001-01-25 13:08:21 +0000
commitc8b0b264451888299eb41634adb516c896b99932 (patch)
tree9d1293f0f9a3181ceef442c30d6af7e0cb25e256
parent7f41c9df6a056c830e6681928ba6ff405fde2c34 (diff)
downloadbugs-c8b0b264451888299eb41634adb516c896b99932.tar
bugs-c8b0b264451888299eb41634adb516c896b99932.tar.gz
bugs-c8b0b264451888299eb41634adb516c896b99932.tar.bz2
bugs-c8b0b264451888299eb41634adb516c896b99932.tar.xz
bugs-c8b0b264451888299eb41634adb516c896b99932.zip
Fix for bug 66058: dates in Created and Changed date columns in buglists are now in context with how old the bug is.
within the last 18 hours: time only (12:24:34) within the last 6 days: weekday and time (Fri 12:24) within the last 100 days: month and day (01-19) older than 100 days: previous behaviour (2001-01-19)
-rwxr-xr-xbuglist.cgi18
1 files changed, 16 insertions, 2 deletions
diff --git a/buglist.cgi b/buglist.cgi
index a7a3e72fe..d8fb94e2d 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -785,9 +785,9 @@ sub DefCol {
$::needquote{$name} = $q;
}
-DefCol("opendate", "date_format(bugs.creation_ts,'%Y-%m-%d')", "Opened",
+DefCol("opendate", "unix_timestamp(bugs.creation_ts)", "Opened",
"bugs.creation_ts");
-DefCol("changeddate", "date_format(bugs.delta_ts,'%Y-%m-%d')", "Changed",
+DefCol("changeddate", "unix_timestamp(bugs.delta_ts)", "Changed",
"bugs.delta_ts");
DefCol("severity", "substring(bugs.bug_severity, 1, 3)", "Sev",
"bugs.bug_severity");
@@ -1040,6 +1040,8 @@ for (my $colcount = 0 ; $colcount < @collist ; $colcount++) {
}
}
+my @weekday= qw( Sun Mon Tue Wed Thu Fri Sat );
+
while (@row = FetchSQLData()) {
my $bug_id = shift @row;
my $g = shift @row; # Bug's group set.
@@ -1099,6 +1101,18 @@ while (@row = FetchSQLData()) {
}
if ($c eq "owner") {
$ownerhash{$value} = 1;
+ }elsif( $c eq 'changeddate' or $c eq 'opendate' ) {
+ my $age= time() - $value;
+ my ($s,$m,$h,$d,$mo,$y,$wd)= localtime $value;
+ if( $age < 18*60*60 ) {
+ $value= sprintf "%02d:%02d:%02d", $h,$m,$s;
+ }elsif( $age < 6*24*60*60 ) {
+ $value= sprintf "%s %02d:%02d", $weekday[$wd],$h,$m;
+ }elsif( $age < 100*24*60*60 ) {
+ $value= sprintf "%02d-%02d", $mo+1,$d;
+ }else {
+ $value= sprintf "%04d-%02d-%02d", 1900+$y,$mo+1,$d;
+ }
}
if ($::needquote{$c} || $::needquote{$c} == 5) {
$value = html_quote($value);