Skip to content
Snippets Groups Projects
Commit fd479ddf authored by Niko Tyni's avatar Niko Tyni
Browse files

Apply upstream patch fixing test failures with Date::Manip v6.x

Closes: #795206
parent 7307e738
No related branches found
No related tags found
No related merge requests found
From d350ade3f32275f739ad1878d7ee0dab9831bcdf Mon Sep 17 00:00:00 2001
From: Tudor Constantin <tudorconstantin@gmail.com>
Date: Sun, 3 May 2015 10:16:13 +0300
Subject: [PATCH] Make the tests pass by ignoring AFT in dates
Bug: https://github.com/pjcj/Gedcom.pm/issues/5
Bug-Debian: https://bugs.debian.org/795206
Origin: upstream, https://github.com/pjcj/Gedcom.pm/commit/42eee593494b50f8c21451df5e5f9e96c0dd6411
---
lib/Gedcom/Record.pm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/Gedcom/Record.pm b/lib/Gedcom/Record.pm
index 1ecc84e..769c7d6 100644
--- a/lib/Gedcom/Record.pm
+++ b/lib/Gedcom/Record.pm
@@ -565,7 +565,15 @@ sub normalise_dates
my @dates = split / or /, $self->{value};
for my $dt (@dates)
{
- # don't change the date if it is just < 7 digits
+ # Don't change the date if it looks like 'AFT 1989'.
+ # AFT means AFTER and ParseDate returns the current date and the tests
+ # are failing.
+ # Current date can symbolize such an "after" date, but can also
+ # symbolize a very specific point in time and that could also confuse
+ # the user.
+ next if $dt =~ /^AFT/;
+
+ # Don't change the date if it is just < 7 digits.
if ($dt !~ /^\s*(\d+)\s*$/ || length $1 > 6)
{
my $date = ParseDate($dt);
--
2.9.3
0001-Make-the-tests-pass-by-ignoring-AFT-in-dates.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment