App::TimelogTxt::Day - Class representing a day as a set of times, events, and durations.
This document describes App::TimelogTxt::Day version 0.22
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 );
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.
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
$stamp
Returns true only if no events have been added to the day.
true
Returns true only the day is complete.
Returns the date stamp for the day in YYYY-MM-DD form.
YYYY-MM-DD
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.
$last
$epoch
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.
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.
$event
Print formatted day information to the supplied filehandle $fh. If no filehandle is supplied, print to STDOUT.
$fh
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.
The output starts with the current datestamp and duration for the day. Indented under that are individual projects.
The output only displays the current datestamp and duration for the day.
Print formatted duration information to the supplied filehandle $fh. If no filehandle is supplied, print to STDOUT.
Returns true if the day contains one or more tasks.
Make a copy of the current Day object containing only the tasks associated with the supplied $project.
Day
$project
Returns true if the day is not currently in a task.
Return the epoch time for the last second of the associated date.
This is the least detailed report.
App::TimelogTxt::Day requires no configuration files or environment variables.
None.
None reported.
No bugs have been reported.
G. Wade Johnson gwadej@cpan.org
gwadej@cpan.org
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.
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.
To install App::TimelogTxt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::TimelogTxt
CPAN shell
perl -MCPAN -e shell install App::TimelogTxt
For more information on module installation, please visit the detailed CPAN module installation guide.