Hi Nigel
On 18/11/15 07:52, njh@bandsman.co.uk via RT wrote:
Show quoted text> Queue: Genealogy-Gedcom-Date
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=108953 >
>
>
>
> Oh dear, that's a shame since one of the great things about G::G::D is
> the ability to compare dates in Gedcom files.
>>
>> You'll have to construct the date either from the 'canonical' key of the
>> returned value, if there is no calendar escape, prefix, date phrase
>> stuff in there, or from the day/month/year keys.
>
> I'll see if I can work out how to do that, or is it documented somewhere?
It's not documented since it didn't occur to me. But it's simple.
parse() returns an arrayref, with 1 element per date. 'Between x and y',
and 'From x to y' both have 2 dates and hence 2 elements. All others
will have 1.
Each element is a hashref, so just compare the 'canonical' keys' values.
This key is always present.
If the reserved words, 'AFT', etc spoil the comparison, just compare the
'day', 'month' and 'year' keys. There can be a 'bce' key too, but it's
missing of there was no BCE-style stuff in the input, whereas the
day/month/year are /almost/ always present. It all depends in the input.
And yes, all this is documented in the FAQ:
https://metacpan.org/pod/Genealogy::Gedcom::Date#FAQ
--
Ron Savage - savage.net.au