| 1 | package App::Standup::Role::Date; | ||
| 2 | use Object::Pad; | ||
| 3 | use Time::Piece; | ||
| 4 | |||
| 5 | role Date { | ||
| 6 | |||
| 7 | no warnings 'experimental'; | ||
| 8 | |||
| 9 | # For some reason, if we use localtime directly it doesn´t use Time::Piece:localtime one | ||
| 10 | field $date :accessor :param { Time::Piece::localtime }; | ||
| 11 | } | ||
| 12 | |||
| 13 | |||
| 14 | =head1 NAME | ||
| 15 | |||
| 16 | App::Standup::Role::Date - Date management for Standup::Diary | ||
| 17 | |||
| 18 | =head1 SYNOPSIS | ||
| 19 | |||
| 20 | class App::Standup::Diary :does( Date ) { ... } | ||
| 21 | |||
| 22 | =head1 DESCRIPTION | ||
| 23 | |||
| 24 | It provides an L<Object::Pad> role with an only C<date> field based on | ||
| 25 | L<Time::Piece>. | ||
| 26 | |||
| 27 | Any class implementing C<App::Standup::Role::Date> have a C<$self->date> instance | ||
| 28 | field. | ||
| 29 | |||
| 30 | =cut |