Match dates

From Gramps
Jump to: navigation, search

Explanation of the date matching logic in Gramps

Where used?

Some filters allow you to search on dates, eg the Person Filter sidebar allows you to filter on the birth date of a person.

The date entered is matched with the date in the birth event of the person, and if it matches you see the result.

How does date matching work

If the date is textual, the text of the date as entered is matched with the textual date.

Eg a birth date of 'happy 2001', will be matched if you search on '2001' or 'py 2001'

If the date is a correct date, the dates are compared. If part of the date corresponds with part of the date you want to match with, the match is considered successful.

Matching is as follows:

  • both dates are transformed to the Gregorian calendar
  • The range of a date is determined
    • 2001-12-12: one day
    • 2001-12 : an entire month
    • 2001 : an entire year
    • before 2001: from 2001-9999 to 2000-12-31
    • after 2001 : from 2002-1-1 to 2002+9999
    • about 2001 : between 2001-10=1991 to 2001+10=2011 (same for abt, around, circa)
    • estimated 2001: between 2001-10=1991 to 2001+10=2011
    • calculated 2001: no influence, considered as 2001

Special cases:

  • mixed date: eg 1735/6-12-12, as the meaning of this is 1736-12-12 in Gregorian calendar, 1736-12-12 is used with the above mentioned rules.

Changing after/before/about range

The ranges taken by gramps are set by keys. These keys can be added to your ~/.gramps/keys.ini file. Eg, you could add to the behavior group:

[behavior]
date-before-range=9999
date-after-range=9999
date-about-range=10

These are the default values. If you want to ahve that before only reaches back 100 years on matches, give instead:

[behavior]
date-before-range=100
date-after-range=9999
date-about-range=10

Note that you can only change this file if Gramps is not running.