Date Analysis

From TNG_Wiki
Revision as of 16:54, 4 March 2016 by WarrenGilbert (talk | contribs) (Date Analysis mod)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Date Analysis
Summary A standalone report showing analysis of dates in the TNG database according to GEDCOM 5.5 standards
Validation {{{mod_validation}}}
Mod Updated {{{mod_last_update}}}
Download link
TNG 10.1.0
Download stats {{{download_stats}}}
Author(s) Warren Gilbert
Homepage Date Analysis
Mod Support Support for Warren Gilbert's mods
Contact Developer Support for Warren Gilbert's mods
Latest Mod
Min TNG V 10.1
Max TNG V 10.1.3
Files modified
English/cust_text.php, English-UTF8/cust_text.php
Related Mods

Purpose of the Mod

Creates a standalone script - dateanalysis.php - to allow analysis of date fields in the TNG database.

GEDCOM 5.5 standard defines possible date formats:

  1. Exact - day, month, year - e.g. 31 Dec 1940
  2. Incomplete - month, year - e.g. Dec 1940
  3. Incomplete - year only - e.g. 1940
  4. Approximate - dates using ABT, CAL, EST - e.g. ABT 1940
  5. Date range - dates using BET, BEF or AFT - e.g. BET 1935 AND 1939
  6. Period - dates using FROM and/or TO - e.g. FROM 1935 TO 1940
  7. Phrase - a phrase enclosed in parentheses - e.g. (Summer 1940)

    In addition, the analysis also checks for date fields set to:

  8. Blank (empty)
  9. NULL
  10. Y

Any content other than the above will be categorised as "Other".

Compatibility With Other Mods

Should be compatible with any other mod.




  • A working TNG installation.
  • An installed current version of the Mod Manager.

Automated Installation

  1. Remove and delete previous version of this mod.
  2. Backup the files updated by this mod. They are listed under Files modified in the panel at the upper right.
  3. Download the .zip file, Extract its .cfg file to the mods folder.
  4. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files.

Optional Parameter

Restrict access to admin only: This is enabled by default (true). Set to false to enable non-administrator access.
Note: editing of the parameter is only available after the mod has been installed.

Using the script

Once installed, the script can be run by typing in the url directly into the browser's address bar; by coding a link into your Homae Page (or any other page) - <a href="dateanalysis.php/">Date Analysis</a>; or, as I have done, add an item to the Info drop down using the Custom Menu Hook - i.e. add the following to your customconfig.php file.

$link_nr = 0; 
$infomenulinks[$link_nr]['target'] = "dateanalysis.php";
$infomenulinks[$link_nr]['sprite'] = "dates-icon";
$infomenulinks[$link_nr]['label_text'] = "Date Analysis";
$infomenulinks[$link_nr]['admin'] = true;

In the event of a problem

  1. Try using the Mod Manager Remove capability
  2. Contact me through Support for my mods.

Visualisation of this Mod

The script displays 3 pages: Select, Summary, Detail.

LDS dates will be listed, depending on the settings in config.php and the access rights of the logged in user.

DateAnalysis 1.png The select page displays a list of date columns from the TNG database.

A date column is assumed to have a name ending with "date" (e.g. birthdate) or beginning with "date" (e.g. datetaken) and to be a "variable character" column.

Select one or more columns, and click on the "Analyse Selected" button.
DateAnalysis 2.png The summary page displays an analysis of each column selected, giving the number of occurrences of each date format.

Each total is a link to display a detail page of all the rows from the table where the date column is in the format selected. The detail page will open in a new tab/window.
DateAnalysis 3.png The detail will vary, depending on the selection from the summary page.

Links are provided to specific items where possible.

Custom Text

The following string is defined in the English and English-UTF8 versions of cust_test.php

$text['analyseselected'] = "Analyse Selected";
$text['citedate'] = "Citation Date";
$text['column'] = "Column";
$text['daselect'] = "Select one or more date columns to analyse";
$text['dateanalysis'] = "Date analysis";
$text['datetaken'] = "Date Taken";
$text['mediatype'] = "Collection";
$text['selectcolumn'] = "Please select at least one column";
$text['summary'] = "Summary";
$text['table'] = "Table";
$text['total'] = "Total";

You can modify these strings by redefining them at the bottom of your language cust_text.php file

Mod Change History

Mod Version TNG Version Date Note 10.1.0 - 10.1.3 29 Feb 2016 New mod.

Sites using this mod

If you download and install this mod, please add your site to the table below.

URL User Note Mod-Version TNG-Version User-language
Gilbert Family History (administrator only) Warren Gilbert Mod developer 10.1.3 English