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

NAME

App::TimelogTxt::Day - Class representing a day as a set of times, events, and durations.

VERSION

This document describes App::TimelogTxt::Day version 0.06

SYNOPSIS

    use App::TimelogTxt::Day;

    my $day = App::TimelogTxt::Day->new( '2013-07-02' );
    my $last;
    while( my $event = get_new_event() )
    {
        $day->update_dur( \%last, $event->epoch );
        $day->start_task( $event );
        $last = $event;
    }
    $day->print_day_detail( \*STDOUT );

DESCRIPTION

Objects of this class represent the events of a particular day. The object tracks projects and combines time spent on the same task from multiple points in the day.

The class also provides the ability to print various reports on the day's activities.

INTERFACE

new( $stamp )

Creates a Day object that collects the events for the date specified by the $stamp. This $stamp must be in the standard format YYYY-MM-DD

$d->is_empty()

Returns true only if no events have been added to the day.

$d->is_complete()

Returns true only the day is complete.

$d->date_stamp()

Returns the date stamp for the day in YYYY-MM-DD form.

$d->update_dur( $last, $epoch )

Update the duration of the most recent task, using the $last variable which contains the information from the last event and the $epoch time from the new event.

$d->close_day( $last )

Update the duration of the most recent task, using the $last variable which contains the information from the last event and the end of the day time.

$d->start_task( $event )

Initialize a new task item in the day based on the App::TimelogTxt::Event object supplied in $event. This method only starts a task if no previous matching task exists in the day.

$d->print_day_detail( $fh )

Print formatted day information to the supplied filehandle $fh. If no filehandle is supplied, print to STDOUT.

The output starts with the current datestamp and duration for the day. Indented under that are individual projects. Individual tasks are indented under the projects.

This is the most detailed report.

$d->print_day_summary( $fh )

Print formatted day information to the supplied filehandle $fh. If no filehandle is supplied, print to STDOUT.

The output starts with the current datestamp and duration for the day. Indented under that are individual projects.

$d->print_hours( $fh )

Print formatted day information to the supplied filehandle $fh. If no filehandle is supplied, print to STDOUT.

The output only displays the current datestamp and duration for the day.

$day->is_complete()

Returns true if the day is not currently in a task.

$d->day_end()

Return the epoch time for the last second of the associated date.

This is the least detailed report.

CONFIGURATION AND ENVIRONMENT

App::TimelogTxt::Day requires no configuration files or environment variables.

DEPENDENCIES

None.

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

No bugs have been reported.

AUTHOR

G. Wade Johnson gwadej@cpan.org

LICENCE AND COPYRIGHT

Copyright (c) 2013, G. Wade Johnson gwadej@cpan.org. All rights reserved.

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

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.