diff --git a/gramps/plugins/export/exportgedcom.py b/gramps/plugins/export/exportgedcom.py index d28f88b32..86fba74eb 100644 --- a/gramps/plugins/export/exportgedcom.py +++ b/gramps/plugins/export/exportgedcom.py @@ -1169,16 +1169,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 == 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 == 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/gramps/plugins/webreport/narrativeweb.py b/gramps/plugins/webreport/narrativeweb.py index a57e9d3b2..0703baed8 100644 --- a/gramps/plugins/webreport/narrativeweb.py +++ b/gramps/plugins/webreport/narrativeweb.py @@ -136,7 +136,7 @@ from gramps.plugins.lib.libhtml import Html, xml_lang # import styled notes from src/plugins/lib/libhtmlbackend.py from gramps.plugins.lib.libhtmlbackend import HtmlBackend, process_spaces -from gramps.plugins.lib.libgedcom import make_gedcom_date +from gramps.plugins.lib.libgedcom import make_gedcom_date, DATE_QUALITY from gramps.gen.utils.place import conv_lat_lon from gramps.gui.pluginmanager import GuiPluginManager @@ -511,14 +511,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