File Coverage

blib/lib/Rose/HTML/Form/Field/DateTime/StartDate.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Rose::HTML::Form::Field::DateTime::StartDate;
2              
3 2     2   962 use strict;
  2         6  
  2         68  
4              
5 2     2   12 use base 'Rose::HTML::Form::Field::DateTime';
  2         12  
  2         260  
6              
7             our $VERSION = '0.606';
8              
9             1;
10              
11             __END__
12              
13             =head1 NAME
14              
15             Rose::HTML::Form::Field::DateTime::StartDate - Text field for a "start date" in a date range.
16              
17             =head1 SYNOPSIS
18              
19             $field =
20             Rose::HTML::Form::Field::DateTime::StartDate->new(
21             label => 'Date',
22             name => 'date',
23             default => '12/31/2002');
24              
25             print $field->internal_value; # "2002-12-31T00:00:00"
26             print $field->output_value; # "2002-12-31 00:00:00 PM"
27              
28             $field->input_value('blah');
29              
30             # "Could not parse date: blah"
31             $field->validate or warn $field->error;
32              
33             $field->input_value('4/30/1980 5:30 p.m.');
34              
35             $dt = $field->internal_value; # DateTime object
36              
37             print $dt->hour; # 17
38             print $dt->day_name; # Wednesday
39              
40             print $field->html;
41             ...
42              
43             =head1 DESCRIPTION
44              
45             L<Rose::HTML::Form::Field::DateTime::StartDate> is a subclass of L<Rose::HTML::Form::Field::DateTime> that pins the time to the very first moment of the specified date (i.e., 00:00:00.00000000) if the time is left unspecified.
46              
47             =head1 AUTHOR
48              
49             John C. Siracusa (siracusa@gmail.com)
50              
51             =head1 LICENSE
52              
53             Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.