| 1 | package Rose::DateTime::Parser; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use Rose::DateTime::Util(); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use Rose::Object; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | our @ISA = qw(Rose::Object); | |||||||||
| 9 | |||||||||||
| 10 | use Rose::Object::MakeMethods::Generic | ||||||||||
| 11 | 1 | ▶ | ( | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | scalar => 'error', | |||||||||
| 13 | 'scalar --get_set_init' => 'time_zone', | ||||||||||
| 14 | 1 | ); | |||||||||
| 15 | |||||||||||
| 16 | 1 | our $VERSION = '0.50'; | |||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | sub init_time_zone { Rose::DateTime::Util->time_zone } | ||||||||
|
Subroutine
init_time_zone: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 19 | 3 | ▶ | sub init_european { Rose::DateTime::Util->european_dates } | ||||||||
|
Subroutine
init_european: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 20 | |||||||||||
| 21 | sub european | ||||||||||
| 22 | 12 | ▶ | { | ||||||||
|
Subroutine
european: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||
| 23 | 12 | my($self) = shift; | |||||||||
| 24 | |||||||||||
| 25 | 12 | ▶ | if(@_) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | { | ||||||||||
| 27 | 3 | ▶ | if(defined $_[0]) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | { | ||||||||||
| 29 | 2 | ▶ | return $self->{'european'} = $_[0] ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | } | ||||||||||
| 31 | 1 | else { $self->{'european'} = undef } | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 10 | ▶ | return $self->{'european'} if(defined $self->{'european'}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 3 | $self->{'european'} = $self->init_european; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | sub parse_date | ||||||||||
| 39 | 7 | ▶ | { | ||||||||
|
Subroutine
parse_date: called CC=3 SCAR=11.3
Pod
documented
| |||||||||||
| 40 | 7 | my($self) = shift; | |||||||||
| 41 | |||||||||||
| 42 | 7 | my $date; | |||||||||
| 43 | |||||||||||
| 44 | 7 | ▶ | if($self->european) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | { | ||||||||||
| 46 | 3 | $date = Rose::DateTime::Util::parse_european_date(shift, $self->time_zone); | |||||||||
| 47 | } | ||||||||||
| 48 | else | ||||||||||
| 49 | { | ||||||||||
| 50 | 4 | local $Rose::DateTime::Util::European_Dates = 0; | |||||||||
| 51 | 4 | $date = Rose::DateTime::Util::parse_date(shift, $self->time_zone); | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 7 | ▶ | return $date if($date); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | 0 | $self->error(Rose::DateTime::Util->error); | |||||||||
| 56 | 0 | return $date; | |||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | 1 | *parse_datetime = \&parse_date; | |||||||||
| 60 | |||||||||||
| 61 | sub parse_european_date | ||||||||||
| 62 | 1 | ▶ | { | ||||||||
|
Subroutine
parse_european_date: called CC=2 SCAR=8.4
Pod
documented
| |||||||||||
| 63 | 1 | my($self) = shift; | |||||||||
| 64 | 1 | my $date = Rose::DateTime::Util::parse_european_date(shift, $self->time_zone); | |||||||||
| 65 | 1 | ▶ | return $date if($date); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 66 | 0 | $self->error(Rose::DateTime::Util->error); | |||||||||
| 67 | 0 | return $date; | |||||||||
| 68 | } | ||||||||||
| 69 | |||||||||||
| 70 | 1 | 1; | |||||||||
| 71 | |||||||||||
| 72 | __END__ | ||||||||||