diff --git a/src/plugins/export/ExportGedcom.py b/src/plugins/export/ExportGedcom.py index cb4af7601..7462ff478 100644 --- a/src/plugins/export/ExportGedcom.py +++ b/src/plugins/export/ExportGedcom.py @@ -1164,16 +1164,22 @@ class GedcomWriter(UpdateCallback): cal = date.get_calendar() mod = date.get_modifier() quality = date.get_quality() + if quality in libgedcom.DATE_QUALITY: + qual_text = libgedcom.DATE_QUALITY[quality] + " " + else: + qual_text = "" if mod == gen.lib.Date.MOD_SPAN: - val = "FROM %s TO %s" % ( - libgedcom.make_gedcom_date(start, cal, mod, quality), + val = "%sFROM %s TO %s" % ( + qual_text, + libgedcom.make_gedcom_date(start, cal, mod, None), libgedcom.make_gedcom_date(date.get_stop_date(), - cal, mod, quality)) + cal, mod, None)) elif mod == gen.lib.Date.MOD_RANGE: - val = "BET %s AND %s" % ( - libgedcom.make_gedcom_date(start, cal, mod, quality), + val = "%sBET %s AND %s" % ( + qual_text, + libgedcom.make_gedcom_date(start, cal, mod, None), libgedcom.make_gedcom_date(date.get_stop_date(), - cal, mod, quality)) + cal, mod, None)) else: val = libgedcom.make_gedcom_date(start, cal, mod, quality) self.__writeln(level, 'DATE', val) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 780424fb0..5804b1995 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -140,7 +140,7 @@ from libhtml import Html # import styled notes from src/plugins/lib/libhtmlbackend.py from libhtmlbackend import HtmlBackend, process_spaces -from libgedcom import make_gedcom_date +from libgedcom import make_gedcom_date, DATE_QUALITY from PlaceUtils import conv_lat_lon from gui.pluginmanager import GuiPluginManager @@ -519,14 +519,20 @@ def format_date(date): cal = date.get_calendar() mod = date.get_modifier() quality = date.get_quality() + if quality in libgedcom.DATE_QUALITY: + qual_text = libgedcom.DATE_QUALITY[quality] + " " + else: + qual_text = "" if mod == Date.MOD_SPAN: - val = "FROM %s TO %s" % ( - make_gedcom_date(start, cal, mod, quality), - make_gedcom_date(date.get_stop_date(), cal, mod, quality)) + val = "%sFROM %s TO %s" % ( + qual_text, + make_gedcom_date(start, cal, mod, None), + make_gedcom_date(date.get_stop_date(), cal, mod, None)) elif mod == Date.MOD_RANGE: - val = "BET %s AND %s" % ( - make_gedcom_date(start, cal, mod, quality), - make_gedcom_date(date.get_stop_date(), cal, mod, quality)) + val = "%sBET %s AND %s" % ( + qual_text, + make_gedcom_date(start, cal, mod, None), + make_gedcom_date(date.get_stop_date(), cal, mod, None)) else: val = make_gedcom_date(start, cal, mod, quality) return val