Order Facts by Sort Date Plugin

Introduction

This ensures every Fact has a Sort Date similar to other products, and sorts them according to those dates. The Export Gedcom File Plugin will export each Sort Date as an _SDATE Sort Date for products such as GedSite and RootsMagic.

Initially, when there are fewer than 9 Sort Dates in the Project, the Plugin prompts to import Sort Dates from a GEDCOM file exported by products such as The Master Genealogist (TMG), or to create Sort Dates from the details within the Project.

Thereafter, when there are more Sort Dates in the Project, the Plugin does not prompt, but does ensure that every fact has a reasonable Sort Date before sorting according to those dates.

Details

Sort Date Format

Each fact has a dummy Local Multimedia Object (LMO) with just a Title of 'Sort Date' and its Date field. They can only be edited on the All tab of a Property Box or in the Records Window for Individuals or Families.

To create a Sort Date manually, open the Property Box of an Individual or Family record, and choose the All tab. Right-click on a fact and choose Add Multimedia Object > Add Local Multimedia Object to this Record, enter a Title of 'Sort Date', and right-click to add a Date, then optionally delete the Format and File fields.

This format has the following advantages:

  • Fully GEDCOM compliant, and enforces all Date formats
  • Easily added on All tab, and looks neatly like a dedicated Sort Date
  • Does NOT appear in any Reports (except the Record Detail Reports)
  • LMO are rarely used, but this Sort Date variant is easily differentiated from any real LMO
  • Easily managed by Plugins that can automatically create them and tidy malformed LMO where the Title was misspelt or missing, and remove empty Format & File fields.

WARNING ~ The File > Merge/Compare File command converts all LMO into linked Media Records without warning when the Merge is invoked, and thus renders all those Sort Dates useless!

Few Fact Sort Dates

When few Sort Dates exist in the Project the Plugin issues a user dialogue prompt.

That optionally allows the choice of a GEDCOM File containing one _SDATE Sort Date per fact. Such files should be generated shortly after migrating from another product such as TMG. See how to Import Fact Sort Dates from TMG for details.

Any other fact will have its Sort Date automatically derived as explained in the Sort Date Auto-Derivation section below.

The dialogue needs a Mode for dates missing a day or month to be chosen:

  • Before other dates assigns 1st day of month for a missing Day, and Jan for a missing Month, so 1900 becomes 1 Jan 1900
  • After other dates assigns last day of month for a missing Day, and Dec for a missing Month, so 1900 becomes 31 Dec 1900

The dialogue also allows the Plugin to be cancelled, and this help & advice page to be displayed.

On completion, the Plugin shows a summary of how many Sort Dates were derived from each of the rules listed in the Sort Date Auto-Derivation section below, and a Result Set Display of GEDCOM Exceptions may be produced.

Order Facts by Sort Date Dialogue

Many Fact Sort Dates

When many Sort Dates exist in the Project the Plugin ensures any fact missing a Sort Date has one automatically derived as explained in the Sort Date Auto-Derivation section below.

On completion, the Plugin shows a summary of how many Sort Dates were derived from each of the rules listed in the Sort Date Auto-Derivation section below, and a Result Set Display of Project Exceptions may be produced.

Sort Date Auto-Derivation

Each new Sort Date is auto-created according to the following precedence rules:

  1. If a Sort Date already exists, that will be retained and validated against the fact Date
  2. If a GEDCOM File was chosen, then its _SDATE Sort Date should get used
  3. If a Note labelled 'Sort Date: ' exists, that will be used and the labelled Note deleted
  4. If a fact Date exists, that will be used, unless it is same Date as in the previous fact
  5. Undated facts, or same Date as previous fact, use the previous fact Sort Date + 1 day
  6. Initial undated Individual facts will use the synthetic 1 Jan 1000 by default
  7. Initial undated Family facts will use a date derived from the Birth/Death Date of Children and Spouses, or 1 Jan 3000 by default

When converting from an existing fact Date to a new Sort Date the following rules apply:

  • Default day & month comes from the Few Fact Sort Dates Mode for dates missing a day or month
  • For any Period or Range the earlier of the pair of Dates is used
  • If the month is omitted from a Date, the default month (January or December) is used,
    except that Before dates always use January and After dates always use December
  • If the day is omitted from a Date, the default day (1st or last of month) is used,
    except that Before dates always use 1st and After dates always use last day
  • Finally, a Before date has one day subtracted, and an After date has one day added.

Automatic Fact Sorting

This Plugin will sort facts according to their Sort Date but that order may only be fully apparent on the All tab of the Property Box, or in the Records Window, or in Reports. The Facts tab by default will predominantly still list facts in their Date order.

See the fh commands for Sorting Children, Spouses & Facts into Order that work on actual fact Dates and their Normal Time Frame. Those commands may disrupt the Sort Date order.

Result Set Display

GEDCOM Exceptions

This is only produced for Projects where few facts have Sort Dates already. It lists facts found in the chosen GEDCOM File that do NOT match facts in the Project or that do NOT have a Sort Date.

The column details identify the values in the GEDCOM File and each Sort Date must be corrected in the associated Project fact by hand, or the problem reported in the FHUG Forums.

Project Exceptions

This is only produced for Projects where many facts have Sort Dates already. It identifies new facts that needed a new Sort Date, and old facts whose Date has changed but whose Sort Date has not.

It lists each Fact Summary against its parent Record Name and Sort Date. The Derivation identifies which rule from the Sort Date Auto-Derivation section was used, or that it Differs from Fact Date.

Version History

  • V1.0 First published version in Plugin Store
  • V0.1-0.9 Prototype versions
CC Attribution-Noncommercial-Share Alike 4.0 International
Runs using DokuWiki Recent changes RSS feed www.rjt.org.uk