{"id":10577,"date":"2020-07-03T12:53:47","date_gmt":"2020-07-03T12:53:47","guid":{"rendered":"https:\/\/fhug.org.uk\/kb\/?post_type=kb_article&#038;p=10577"},"modified":"2024-02-22T12:13:44","modified_gmt":"2024-02-22T12:13:44","slug":"fixing-dates-and-date-phrases","status":"publish","type":"kb_article","link":"https:\/\/www.fhug.org.uk\/kb\/kb-article\/fixing-dates-and-date-phrases\/","title":{"rendered":"Fixing Dates and Date Phrases"},"content":{"rendered":"<p>Many other programs allow arbitrary formats for dates, that Family Historian will often interpret as Date Phrases, which can easily be recognised as they are shown in quotation marks. Using plugins it is possible to correct the majority if they are consistently formatted.<\/p>\n<h2>Getting Started<\/h2>\n<p>A good place to start is to download and run the <a href=\"https:\/\/pluginstore.family-historian.co.uk\/page\/plugin\/find-date-phrases\">Find Date Phrases<\/a> plugin. If it only lists a few Date Phrases in its Result Set, it is normally a quick job to double click on the Date column items to jump to the Date fields and correct them.<\/p>\n<h3>Correcting Dates with &#8220;Fix Date Fields&#8221;<\/h3>\n<p>Download and run the <a href=\"https:\/\/pluginstore.family-historian.co.uk\/page\/plugin\/fix-date-fields\">Fix Date Fields<\/a> plugin.<\/p>\n<p>Use the List option to see what might get fixed.<\/p>\n<p>Then after creating a backup, use the Mend option.<\/p>\n<p>If any Dates are still NOT FIXED then try the techniques below or ask for assistance in the Forums.<\/p>\n<h3>Correcting Dates with a Custom Plugin<\/h3>\n<p>Open the <a href=\"#!\" class=\"cs_tooltip\" fhugtt=\"This is the menu across the top of the main Family Historian windows. The &gt; denotes a submenu\">Tools&nbsp&gt;&nbspPlugins<\/a> window and click the More\u00bb button, select the <a href=\"https:\/\/pluginstore.family-historian.co.uk\/page\/plugin\/fix-date-fields\">Fix Date Fields <\/a> plugin, and click Edit. Then use the <a href=\"#!\" class=\"cs_tooltip\" fhugtt=\"This is the menu across the top of the main Family Historian windows. The &gt; denotes a submenu\">File&nbsp&gt;&nbspSave&nbspAs<\/a> option to save the plugin with a new Plugin Name such as Fix Date Phrases.<\/p>\n<p>Reviewing the code you will find a table of conversion codes around lines 250 to 280. These use LUA Patterns to define the Date to be detected and its replacement. Simply copy &amp; paste one of the existing lines and change the patterns. Ask for help in the Forums if you cannot figure out what is needed.<\/p>\n<h3>Correcting Dates with &#8220;Search and Replace&#8221;<\/h3>\n<p>Date fields can be corrected using the <a href=\"https:\/\/pluginstore.family-historian.co.uk\/page\/plugin\/search-and-replace\">Search and Replace<\/a> plugin, but does require an understanding of LUA Patterns.<\/p>\n<p>Run the Search and Replace Plugin:<\/p>\n<ul>\n<li>Ensure Search Scope: is All Records &amp; Events\/Attributes.<\/li>\n<li>In Basic Filters untick every option except Date fields.<\/li>\n<li><span lang=\"en-gb\"> <span style=\"font-family: Arial; font-size: small;\">In Search Criteria e<\/span><\/span><span lang=\"en-gb\"><span style=\"font-family: Arial; font-size: small;\">nsure LUA Pattern Mode is selected<\/span><\/span>.<\/li>\n<li>Enter <a href=\"https:\/\/fhug.org.uk\/kb\/kb-article\/understanding-lua-patterns\/\">LUA Patterns<\/a> into the Search and Replace boxes based on the examples below.<\/li>\n<li>Click Search &amp; Replace button, and click Replace button to confirm each change.<\/li>\n<li>When satisfied the changes are OK, untick Confirm every item found and click Replace once.<\/li>\n<li>When complete a Result Set of changes is listed.<\/li>\n<li>Double-click any new Date to open its Property Box.<\/li>\n<\/ul>\n<h4 style=\"padding-left: 40px;\">&#8220;BET Day AND Day Month Year&#8221;<\/h4>\n<p style=\"padding-left: 40px;\">Search: between 00(%d%d) and (%d+) (%a+ %d%d%d%d)<br \/>\nReplace: between %1 %3 and %2 %3<\/p>\n<h4 style=\"padding-left: 40px;\">&#8220;BET Day Month AND Date&#8221;<\/h4>\n<p style=\"padding-left: 40px;\">Search: &#8220;BET (%d- ?%a+) AND (.-) (%d%d%d%d)&#8221;<br \/>\nReplace: between %1 %3 and %2 %3<\/p>\n<h4 style=\"padding-left: 40px;\">&#8220;BET Date AND Date&#8221;<\/h4>\n<p style=\"padding-left: 40px;\">Search: &#8220;BET (.-%d%d%d%d) AND (.-%d%d%d%d)&#8221;<br \/>\nReplace: between %1 and %2<\/p>\n<h4 style=\"padding-left: 40px;\">&#8220;Day-Day Month Year&#8221;<\/h4>\n<p style=\"padding-left: 40px;\">Search: &#8220;(%d+)%-(%d+) (%a+ %d%d%d%d)&#8221;<br \/>\nReplace: from %1 %3 to %2 %3<\/p>\n","protected":false},"template":"","fh_version":[14,15,739],"skill_level":[18,17],"topic":[725,58],"class_list":["post-10577","kb_article","type-kb_article","status-publish","hentry","fh_version-v5","fh_version-v6","fh_version-v7","skill_level-advanced","skill_level-intermediate","topic-importing","topic-importing-and-exporting"],"_links":{"self":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/kb_article\/10577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/kb_article"}],"about":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/types\/kb_article"}],"wp:attachment":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/media?parent=10577"}],"wp:term":[{"taxonomy":"fh_version","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/fh_version?post=10577"},{"taxonomy":"skill_level","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/skill_level?post=10577"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/topic?post=10577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}