| 1 | package HTML::FormHandler::Field::Year; | ||
| 2 | # ABSTRACT: year selection list | ||
| 3 | 2 | $HTML::FormHandler::Field::Year::VERSION = '0.410001'; | |
| 4 | 2 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | extends 'HTML::FormHandler::Field::IntRange'; | |
| 6 | |||
| 7 | has '+range_start' => ( | ||
| 8 | default => sub { | ||
| 9 | 2 | ▶ | my $year = (localtime)[5] + 1900 - 5; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 10 | 2 | return $year; | |
| 11 | } | ||
| 12 | 2 | ); | |
| 13 | has '+range_end' => ( | ||
| 14 | default => sub { | ||
| 15 | 2 | ▶ | my $year = (localtime)[5] + 1900 + 10; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 16 | 2 | return $year; | |
| 17 | } | ||
| 18 | 2 | ); | |
| 19 | |||
| 20 | |||
| 21 | 2 | __PACKAGE__->meta->make_immutable; | |
| 22 | 2 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 23 | 2 | 1; | |
| 24 | |||
| 25 | __END__ | ||
| 26 | |||
| 27 | =pod | ||
| 28 | |||
| 29 | =encoding UTF-8 | ||
| 30 | |||
| 31 | =head1 NAME | ||
| 32 | |||
| 33 | HTML::FormHandler::Field::Year - year selection list | ||
| 34 | |||
| 35 | =head1 VERSION | ||
| 36 | |||
| 37 | version 0.410001 | ||
| 38 | |||
| 39 | =head1 DESCRIPTION | ||
| 40 | |||
| 41 | Provides a list of years starting five years back and extending 10 years into | ||
| 42 | the future. | ||
| 43 | |||
| 44 | =head1 AUTHOR | ||
| 45 | |||
| 46 | FormHandler Contributors - see HTML::FormHandler | ||
| 47 | |||
| 48 | =head1 COPYRIGHT AND LICENSE | ||
| 49 | |||
| 50 | This software is copyright (c) 2017 by Gerda Shank. | ||
| 51 | |||
| 52 | This is free software; you can redistribute it and/or modify it under | ||
| 53 | the same terms as the Perl 5 programming language system itself. | ||
| 54 | |||
| 55 | =cut | ||