File Coverage

blib/lib/Locale/CLDR/Locales/Ar/Any/Km.pm
Criterion Covered Total %
statement 23 23 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 31 31 100.0


line stmt bran cond sub pod time code
1             =head1
2              
3             Locale::CLDR::Locales::Ar::Any::Km - Package for language Arabic
4              
5             =cut
6              
7             package Locale::CLDR::Locales::Ar::Any::Km;
8             # This file auto generated from Data\common\main\ar_KM.xml
9             # on Sun 24 Apr 8:14:51 am GMT
10              
11 1     1   753 use version;
  1         1  
  1         5  
12              
13             our $VERSION = version->declare('v0.29.0');
14              
15 1     1   80 use v5.10.1;
  1         3  
16 1     1   4 use mro 'c3';
  1         1  
  1         5  
17 1     1   28 use utf8;
  1         1  
  1         5  
18 1     1   24 use if $^V ge v5.12.0, feature => 'unicode_strings';
  1         1  
  1         10  
19              
20 1     1   90 use Types::Standard qw( Str Int HashRef ArrayRef CodeRef RegexpRef );
  1         1  
  1         5  
21 1     1   642 use Moo;
  1         1  
  1         5  
22              
23             extends('Locale::CLDR::Locales::Ar::Any');
24             has 'day_period_data' => (
25             is => 'ro',
26             isa => CodeRef,
27             init_arg => undef,
28             default => sub { sub {
29             # Time in hhmm format
30             my ($self, $type, $time, $day_period_type) = @_;
31             $day_period_type //= 'default';
32             SWITCH:
33             for ($type) {
34             if ($_ eq 'gregorian') {
35             if($day_period_type eq 'selection') {
36             return 'night1' if $time >= 0
37             && $time < 100;
38             return 'morning2' if $time >= 600
39             && $time < 1200;
40             return 'afternoon1' if $time >= 1200
41             && $time < 1300;
42             return 'afternoon2' if $time >= 1300
43             && $time < 1800;
44             return 'morning1' if $time >= 300
45             && $time < 600;
46             return 'night2' if $time >= 100
47             && $time < 300;
48             return 'evening1' if $time >= 1800
49             && $time < 2400;
50             }
51             if($day_period_type eq 'default') {
52             return 'evening1' if $time >= 1800
53             && $time < 2400;
54             return 'night2' if $time >= 100
55             && $time < 300;
56             return 'night1' if $time >= 0
57             && $time < 100;
58             return 'morning2' if $time >= 600
59             && $time < 1200;
60             return 'afternoon1' if $time >= 1200
61             && $time < 1300;
62             return 'afternoon2' if $time >= 1300
63             && $time < 1800;
64             return 'morning1' if $time >= 300
65             && $time < 600;
66             }
67             last SWITCH;
68             }
69             }
70             } },
71             );
72              
73             around day_period_data => sub {
74             my ($orig, $self) = @_;
75             return $self->$orig;
76             };
77              
78             has 'eras' => (
79             is => 'ro',
80             isa => HashRef,
81             init_arg => undef,
82             default => sub { {
83             'gregorian' => {
84             },
85             } },
86             );
87              
88             has 'date_formats' => (
89             is => 'ro',
90             isa => HashRef,
91             init_arg => undef,
92             default => sub { {
93             'gregorian' => {
94             },
95             } },
96             );
97              
98             has 'time_formats' => (
99             is => 'ro',
100             isa => HashRef,
101             init_arg => undef,
102             default => sub { {
103             'gregorian' => {
104             'full' => q{HH:mm:ss zzzz},
105             'long' => q{HH:mm:ss z},
106             'medium' => q{HH:mm:ss},
107             'short' => q{HH:mm},
108             },
109             } },
110             );
111              
112             has 'datetime_formats' => (
113             is => 'ro',
114             isa => HashRef,
115             init_arg => undef,
116             default => sub { {
117             'gregorian' => {
118             },
119             } },
120             );
121              
122             has 'datetime_formats_available_formats' => (
123             is => 'ro',
124             isa => HashRef,
125             init_arg => undef,
126             default => sub { {
127             } },
128             );
129              
130             has 'datetime_formats_append_item' => (
131             is => 'ro',
132             isa => HashRef,
133             init_arg => undef,
134             default => sub { {
135             } },
136             );
137              
138             has 'datetime_formats_interval' => (
139             is => 'ro',
140             isa => HashRef,
141             init_arg => undef,
142             default => sub { {
143             } },
144             );
145              
146 1     1   2388 no Moo;
  1         2  
  1         6  
147              
148             1;
149              
150             # vim: tabstop=4