--- ui.itcl	2004-03-21 12:05:21.000000000 -0800
+++ /home/ccwf/src/TiVo/TivoWebPlus-ccwf/ui.itcl	2005-01-29 12:26:16.000000000 -0800
@@ -4401,12 +4401,14 @@
     puts $chan [tr "" [td [html_link "/history/list/-5,0" "Past 5 days"]]]
     puts $chan [tr "" [td [html_link "/history/list/past" "All past"]]]
     puts $chan [tr "" [td [html_link "/history/list/all" "All"]]]
+    puts $chan [tr "" [td [html_link "/history/list/expired" "Expired"]]]
     puts $chan [html_table_end]
     puts $chan [html_end]
     return
   } else {
     set spath [split $path /]
     set path [join [lrange $spath 1 end] /]
+    set expiredOnly 0
     switch -exact [lindex $spath 0] {
       detail {
         action_history_detail $chan $path $env
@@ -4431,6 +4433,12 @@
             set maxtime $now
           }
 
+	  expired {
+	    set mintime 0
+	    set maxtime $now
+	    set expiredOnly 1
+	  }
+
           default {
             set range [split $path ,]
             set mintime [expr $now + [lindex $range 0] * 86400]
@@ -4459,6 +4467,8 @@
       RetryTransaction {
         set rec [db $db openid $fsid ]
         set creason [dbobj $rec get CancelReason]
+	set cdate [dbobj $rec get CancelDate]
+	set ctime [dbobj $rec get CancelTime]
         set show [dbobj $rec get Showing]
         history_showinfo $show inf
         set id [dbobj $inf(program) get TmsId]
@@ -4483,23 +4493,29 @@
         default { set reason [lindex $cancelreasons [expr $creason - 1]] }
       }
 
-      if {$findalt == 1 && $inf(isEpisode) && $id != ""} {
-        set alt [alt_showing $id $id2]
-        if {$alt == ""} {
-          set reason "<b>$reason</b>"
-        } else {
-          if {[lindex $alt 0] == "nowshowing"} {
-            set alttext "available"
-          } else {
-            set alttext "scheduled"
-          }
-          set alt [lindex $alt 1]
-          set alt [html_link "/showing/$alt" "alternate $alttext"]
-          append reason " ($alt)"
-        }
+      if {! $expiredOnly || $reason == "Expired"} {
+	if {$findalt == 1 && $inf(isEpisode) && $id != ""} {
+	  set alt [alt_showing $id $id2]
+	  if {$alt == ""} {
+	    set reason "<b>$reason</b>"
+	  } else {
+	    if {[lindex $alt 0] == "nowshowing"} {
+	      set alttext "available"
+	    } else {
+	      set alttext "scheduled"
+	    }
+	    set alt [lindex $alt 1]
+	    set alt [html_link "/showing/$alt" "alternate $alttext"]
+	    append reason " ($alt)"
+	  }
+	}
+
+	if {$reason == "Expired"} {
+	  set csecs [expr $cdate * 86400 + $ctime + $tzoffset]
+	  set reason [clock format $csecs -format "Exp %m/%d %H:%M:%S"]
+	}
+	puts $chan [tr "" [td $inf(day)] [td $inf(date)] [td "ALIGN=RIGHT NOWRAP" $inf(time)] [td $inf(channel)] [td $inf(title)] [td $inf(episode)] [td $reason]]
       }
-
-      puts $chan [tr "" [td $inf(day)] [td $inf(date)] [td "ALIGN=RIGHT NOWRAP" $inf(time)] [td $inf(channel)] [td $inf(title)] [td $inf(episode)] [td $reason]]
     }
   }
 

