freeseek / getmyancestors

33 stars 43 forks source link

DATE format #3

Closed ghost closed 8 years ago

ghost commented 9 years ago

Test command: ./getmyancestors.py -a 0 -d 0 -u xxxxx -p xxxxx -i KWZG-8XF -v -o jn.ged

Sometimes the DATEs of certain people in my GEDCOM files look like this: 1 BIRT 2 DATE 18770918

(This causes the birth/death dates to appear malformed when I import the GEDCOM into Ancestry.com)

Compared with other GEDCOM files I've seen, the DATE should look something like this: 1 BIRT 2 DATE 18 September 1877

Although I can write a script or use commandline tools (date -f - +'%d %B %Y', etc) to correct these dates in the resulting GEDCOM, (or better yet, revise the DATEs in FamilySearch for everyone in my tree), it would be easiest to change getmyancestors.py to output the date in "long format" like above. How to do it? Not sure.. Maybe you could use strftime()?

OJFord commented 9 years ago

I had a similar issue - I can't remember offhand but if you log the available date formats, there's 'original' which it currently uses, and a standardised format for which I can't remember the key name (should be pretty obvious though).

Initially I switched them all to use the standardised format, but ran into a couple of occurrences when it didn't exist. So really what you need to do is fall back on 'original' when it's not available - since that's guaranteed to exist, as it's literally "what's entered" - it might be '', but you won't get a KeyError at least, and if it is then no others would exist anyway.

freeseek commented 9 years ago

That is correct. From the https://familysearch.org/platform/tree/persons/KWZG-8XF.json webpage the software currently extracts the following piece of information: data['persons'][0]['facts'][X]['date']['original'] rather than the following piece of information: data['persons'][0]['facts'][X]['date']['normalized'][0]['value'] I had thought about including an option to download the standardized format, but by default I wanted to extract the original string instead.

Now I don't fully understand what is causing your issue as when I go to https://familysearch.org/tree/#view=ancestor&person=KWZG-8XF I see written "18 September 1877" rather than "18770918". Somewhat the system is showing the 'normalized' rather than the 'original' string where the 'original' string should be displayed. I think if you re-write the full string and save it you might be able to change the 'original' variable.