Making date input more flexible

Hi,
I’m new to gramps and just met a similar issue.
I exported a GEDCOM from familysearch. In Familysearch I have some dates that are in english and some other dates that are in Italian (they are both valid dates for familysearch).
My Gramps is set to use english language and YYY-MM-DD ISO format for dates.
When I import the GEDCOM, all the Italian dates are parsed correctly, but the Italian date (i.e. “16 GENNAIO 1950” for 1950-01-16) is copied into the text comment field of the event and this apparently invalidate the date and let it appear in bold.
I came up using the following with supertool:

  1. Events → created a filter on “invalid dates”

  2. Selected all the events

  3. With supertool:

Initialization:


import locale

from datetime import datetime

from gramps.gen.lib import Event,Date

locale.setlocale(locale.LC_ALL, 'it_IT.utf8')

def set_date(italian_date):

italian_date_to_dateObject = datetime.strptime(italian_date.get_text(),'%d %B %Y')

italian_date.set_yr_mon_day(italian_date_to_dateObject.year, italian_date_to_dateObject.month, italian_date_to_dateObject.day)

italian_date.set_text_value(italian_date_to_dateObject.strftime('%Y-%m-%d'))

return italian_date_to_dateObject



Statements executed for each object:

italian_date = event.date

result = set_date(italian_date)



Filter:

result

It worked, but even if I ticked “commit changes” anyway I had to open every single event and just press ok, otherwise even If everything was looking good, dates still appeared in bold as invalid (this is still much quicker than edit every single date). Maybe an option to just delete the text comments ? Because the only problem seems to be related to the text comment, since the date are parsed correctly.

As an example, here one of the problematic dates:

https://www.familysearch.org/tree/person/details/G6RJ-T3P