File Coverage

blib/lib/Date/Japanese/Era/Table.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 Date::Japanese::Era::Table;
2              
3 1     1   474 use utf8;
  1         11  
  1         4  
4 1     1   43 use strict;
  1         2  
  1         173  
5             our $VERSION = '0.04';
6              
7             require Exporter;
8             our @ISA = qw(Exporter);
9             our @EXPORT = qw(%ERA_TABLE %ERA_JA2ASCII %ERA_ASCII2JA);
10              
11             our %ERA_TABLE = (
12             # era => [ $ascii, @begin_ymd, @end_ymd ]
13             "明治" => [ 'meiji', 1868, 9, 8, 1912, 7, 29 ],
14             "大正" => [ 'taishou', 1912, 7, 30, 1926, 12, 24 ],
15             "昭和" => [ 'shouwa', 1926, 12, 25, 1989, 1, 7 ],
16             "平成" => [ 'heisei', 1989, 1, 8, 2019, 4, 30 ],
17             "令和" => [ 'reiwa', 2019, 5, 1, 2999, 12, 31 ], # XXX
18             );
19              
20             our %ERA_JA2ASCII = map { $_ => $ERA_TABLE{$_}->[0] } keys %ERA_TABLE;
21             our %ERA_ASCII2JA = reverse %ERA_JA2ASCII;
22              
23             1;
24             __END__