Gedcom-Date

 view release on metacpan or  search on metacpan

lib/Gedcom/Date.pm  view on Meta::CPAN

    $date->add( years => 18, months => 0, days => 0 );

results in "CAL 10 AUG 2021", while

    $date->add( years => 18 );

results in "CAL 2021".

If the object is a simple date, it will become a calculated date (see
Gedcom::Date::Approximated) after this addition, as shown in the
examples above. If you do not want to advertise that the date is the
result of a calculation, set the C<secret> parameter to 1.

=item * earliest

Returns the earliest possible date; e.g. for the date "BET 10 JUL 2003
AND 20 JUL 2003" it returns July 10, 2003. The value returned is a
DateTime object.

=item * latest

Returns the latest possible date; e.g. for the date "BET 10 JUL 2003
AND 20 JUL 2003" it returns July 20, 2003. The value returned is a
DateTime object.

=item * sort_date

Returns a sortable string, suitable for example for indices. To sort the
individuals in a Gedcom file on birth date:

    my @sorted = map  { $_->[1] }
                 sort { $a->[0] cmp $b->[0] }
                 map  { [ Gedcom::Date->parse($_->birth->date)->sort_date,
                         $_ ] }
                 $gedcom_file->individuals;

=item * gedcom

Returns the date in Gedcom format.

=item * as_text( $locale )

Returns the date in a format that can be included in a narrative text.
You can set the language of the text by passing an optional locale
argument. This should be a DateTime::Locale object, or a valid locale
identifier. The default locale is 'en_GB' by default, but can be set
with the DefaultLocale method.

=back

=head1 AUTHOR

Eugene van der Pijll <pijll@gmx.net>

=head1 REPOSITORY

L<https://github.com/ronsavage/Gedcom-Date>.

=head1 TODO

Implement other calendars (Julian, Hebrew, French).

More languages in as_text().

=head1 See Also

L<Genealogy::Date>.

L<Genealogy::Gedcom::Date>.

=head1 COPYRIGHT

Copyright (c) 2003 Eugene van der Pijll.  All rights reserved.

This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the
LICENSE file included with this module.

=head1 SEE ALSO

perl(1).

=cut



( run in 2.760 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )