From 3eea6dc8dcaf464dabaac2fda0ea95148a4649c6 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Thu, 9 Jun 2011 14:10:20 +0000 Subject: [PATCH] Fix so that date, if any, in source reference is printed. svn: r17731 --- src/ReportBase/_Bibliography.py | 2 +- src/ReportBase/_Endnotes.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ReportBase/_Bibliography.py b/src/ReportBase/_Bibliography.py index 32f7fe4e5..6a7bf91cc 100644 --- a/src/ReportBase/_Bibliography.py +++ b/src/ReportBase/_Bibliography.py @@ -223,7 +223,7 @@ class Bibliography(object): if ( self.mode & self.MODE_DATE ) == self.MODE_DATE: date1 = source_ref1.get_date_object() date2 = source_ref2.get_date_object() - if date1.is_equal(date2): + if not date1.is_equal(date2): return False if ( self.mode & self.MODE_CONF ) == self.MODE_CONF: conf1 = source_ref1.get_confidence_level() diff --git a/src/ReportBase/_Endnotes.py b/src/ReportBase/_Endnotes.py index fa8084c09..1c35363b7 100644 --- a/src/ReportBase/_Endnotes.py +++ b/src/ReportBase/_Endnotes.py @@ -129,7 +129,17 @@ def write_endnotes(bibliography, database, doc, printnotes=False): first = True reflines = "" for key, ref in ref_list: - txt = "%s: %s" % (key, ref.get_page()) + datepresent = False + date = ref.get_date_object() + if date is not None and not date.is_empty(): + datepresent = True + if datepresent: + if ref.get_page(): + txt = "%s: %s - %s" % (key, ref.get_page(), str(date)) + else: + txt = "%s: %s" % (key, str(date)) + else: + txt = "%s: %s" % (key, ref.get_page()) if first: reflines += txt first = False