The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::ListOrgAnniversaries - List all anniversaries in Org files

VERSION

This document describes version 0.482 of App::ListOrgAnniversaries (from Perl distribution App-OrgUtils), released on 2021-07-04.

SYNOPSIS

 # See list-org-anniversaries script

FUNCTIONS

list_org_anniversaries

Usage:

 list_org_anniversaries(%args) -> [$status_code, $reason, $payload, \%result_meta]

List all anniversaries in Org files.

This function expects contacts in the following format:

 * First last                              :office:friend:
   :PROPERTIES:
   :BIRTHDAY:     1900-06-07
   :EMAIL:        foo@example.com
   :OTHERFIELD:   ...
   :END:

or:

 * Some name                               :office:
   - birthday   :: [1900-06-07 ]
   - email      :: foo@example.com
   - otherfield :: ...

Using PROPERTIES, dates currently must be specified in "YYYY-MM-DD" format. Other format will be supported in the future. Using description list, dates can be specified using normal Org timestamps (repeaters and warning periods will be ignored).

By convention, if year is '1900' it is assumed to mean year is not specified.

By default, all contacts' anniversaries will be listed. You can filter contacts using tags ('has_tags' and 'lacks_tags' options), or by 'due_in' and 'max_overdue' options (due_in=14 and max_overdue=7 is what I commonly use in my startup script).

If you have acted on someone's birthday or anniversary, you can add another field with name: the anniversary field + " reminded" (this is customizable using the options reminded_field_pattern). For example:

 * First last                              :office:friend:
   :PROPERTIES:
   :BIRTHDAY:     1900-06-07
   :BIRTHDAY_REMINDED:  2020-06-08
   :EMAIL:        foo@example.com
   :OTHERFIELD:   ...
   :END:

or:

 * Some name                               :office:
   - birthday   :: [1900-06-07 ]
   - birthday reminded :: [2020-06-09]
   - email      :: foo@example.com
   - otherfield :: ...

and the reminder will not be shown again.

This function is not exported by default, but exportable.

Arguments ('*' denotes required arguments):

  • due_in => int

    Only show anniversaries that are due in this number of days.

  • field_pattern => re (default: qr((?:birthday|anniversary))i)

    Regex for fields that specify anniversaries.

  • files* => array[filename]

  • has_tags => array[str]

    Filter headlines that have the specified tags.

  • lacks_tags => array[str]

    Filter headlines that don't have the specified tags.

  • max_overdue => int

    Don't show dates that are overdue more than this number of days.

  • reminded_field_pattern => re (default: qr(reminded)i)

  • reminded_suffix => str (default: " reminded")

  • sort => str|code (default: "due_date")

    Specify sorting.

    If string, must be one of 'date', '-date' (descending).

    If code, sorting code will get [REC, DUE_DATE] as the items to compare, where REC is the final record that will be returned as final result (can be a string or a hash, if 'detail' is enabled), and DUE_DATE is the DateTime object.

  • time_zone => date::tz_name

    Will be passed to parser's options.

    If not set, TZ environment variable will be picked as default.

  • today => obj

    Assume today's date.

    You can provide Unix timestamp or DateTime object. If you provide a DateTime object, remember to set the correct time zone.

Returns an enveloped result (an array).

First element ($status_code) is an integer containing HTTP-like status code (200 means OK, 4xx caller error, 5xx function error). Second element ($reason) is a string containing error message, or something like "OK" if status is 200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth element (%result_meta) is called result metadata and is optional, a hash that contains extra information, much like how HTTP response headers provide additional metadata.

Return value: (any)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-OrgUtils.

SOURCE

Source repository is at https://github.com/perlancar/perl-App-OrgUtils.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-OrgUtils

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org.

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