diff --git a/library.pages.inc b/library.pages.inc
index e7243f6..096fcc1 100644
--- a/library.pages.inc
+++ b/library.pages.inc
@@ -398,10 +398,11 @@ function library_overdue_items() {
           $item = array('library_status' => LIBRARY_ITEM_UNAVAILABLE, 'id' => $id, 'last_patron_id' => $patron_id, 'in_circulatio
           $links = implode(" | ", library_get_action_links($item));
 
-          $rows[] = array($values['item_name'], $patron_name, format_date($values['due_date'], 'small'), l('Item Details', 'node/
+          $rows[$values['due_date'] . str_pad($id,10,'0',STR_PAD_LEFT)] = array($values['item_name'], $patron_name, format_date($
           $item = array();
         }
       }
+      ksort($rows,SORT_NUMERIC);
       $output = theme('table', $header, $rows);
       $output .= theme('pager', NULL, LIBRARY_RESULTS_PER_PAGE, 0);
       return $output;

