summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunjee Kim <hj0426.kim@samsung.com>2019-01-30 15:50:03 +0900
committerHyunjee Kim <hj0426.kim@samsung.com>2019-01-30 15:59:22 +0900
commitf6fd8e11e50cddbc0ca52c672a1bee2a34ec7de3 (patch)
treed55e0690d9d16aa7419b5bfdddd33c8c6b4f3e0e
parent8511956c25f92ccd6094dca45824697ad21cfdd4 (diff)
downloadperl-TimeDate-f6fd8e11e50cddbc0ca52c672a1bee2a34ec7de3.tar.gz
perl-TimeDate-f6fd8e11e50cddbc0ca52c672a1bee2a34ec7de3.tar.bz2
perl-TimeDate-f6fd8e11e50cddbc0ca52c672a1bee2a34ec7de3.zip
Imported Upstream version 2.30upstream/2.30upstream
Change-Id: Ib6e94c21c32222375425677fd657508238622cdf Signed-off-by: Hyunjee Kim <hj0426.kim@samsung.com>
-rw-r--r--.gitignore6
-rw-r--r--ChangeLog3
-rw-r--r--MANIFEST3
-rw-r--r--MANIFEST.SKIP15
-rw-r--r--META.yml21
-rw-r--r--Makefile.PL7
-rw-r--r--SIGNATURE69
-rw-r--r--lib/Date/Language.pm2
-rw-r--r--lib/Date/Language/Bulgarian.pm92
-rw-r--r--t/format.t72
-rw-r--r--t/lang.t2
11 files changed, 183 insertions, 109 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..04de9de
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+Makefile
+blib
+pm_to_blib
+*.bak
+TimeDate-*
+_dev
diff --git a/ChangeLog b/ChangeLog
index 49eca37..512471c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2.30 -- Mon Feb 18 13:31:03 CST 2013
+ * Syncing distribution version number with Date::Parse, not functional changes
+
1.20 -- Sat Dec 12 06:38:14 CST 2009
* Typo => s/timezome/timezone/ [yanick]
diff --git a/MANIFEST b/MANIFEST
index 227442e..7169f9f 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -5,6 +5,7 @@ lib/Date/Language/Afar.pm
lib/Date/Language/Amharic.pm
lib/Date/Language/Austrian.pm
lib/Date/Language/Brazilian.pm
+lib/Date/Language/Bulgarian.pm
lib/Date/Language/Chinese.pm
lib/Date/Language/Chinese_GB.pm
lib/Date/Language/Czech.pm
@@ -43,5 +44,3 @@ t/date.t
t/format.t
t/getdate.t
t/lang.t
-META.yml Module meta-data (added by MakeMaker)
-SIGNATURE Public-key signature (added by MakeMaker)
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
new file mode 100644
index 0000000..4b11c92
--- /dev/null
+++ b/MANIFEST.SKIP
@@ -0,0 +1,15 @@
+MANIFEST.SKIP
+^\.git/
+.gitignore
+blib\b
+cover_db
+^Makefile$
+^Makefile.old$
+\.bak$
+\.bs$
+\.[oc]$
+^arch.txt$
+^TimeDate-
+^_dev
+.*.swp
+MYMETA.*
diff --git a/META.yml b/META.yml
deleted file mode 100644
index 6434fd5..0000000
--- a/META.yml
+++ /dev/null
@@ -1,21 +0,0 @@
---- #YAML:1.0
-name: TimeDate
-version: 1.20
-abstract: ~
-author:
- - Graham Barr <gbarr@pobox.com>
-license: perl
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
-requires: {}
-resources:
- repository: http://github.com/gbarr/perl-TimeDate
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.48
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
diff --git a/Makefile.PL b/Makefile.PL
index c7c6034..7b6643a 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -7,9 +7,10 @@ use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
- NAME => 'TimeDate',
- AUTHOR => 'Graham Barr <gbarr@pobox.com>',
- VERSION => '1.20',
+ NAME => 'Date::Parse',
+ DISTNAME => 'TimeDate',
+ AUTHOR => 'Graham Barr <gbarr@pobox.com>',
+ VERSION_FROM => 'lib/Date/Parse.pm',
(eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
( eval { ExtUtils::MakeMaker->VERSION(6.46) } ? (
META_MERGE => {
diff --git a/SIGNATURE b/SIGNATURE
deleted file mode 100644
index b4879bb..0000000
--- a/SIGNATURE
+++ /dev/null
@@ -1,69 +0,0 @@
-This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.55.
-
-To verify the content in this distribution, first make sure you have
-Module::Signature installed, then type:
-
- % cpansign -v
-
-It will check each file's integrity, as well as the signature's
-validity. If "==> Signature verified OK! <==" is not displayed,
-the distribution may already have been compromised, and you should
-not run its Makefile.PL or Build.PL.
-
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-SHA1 036da21b212a902ecb9d195565bbcd4c51bccecc ChangeLog
-SHA1 efb2a90cd095d97ec148e6263fb921f560cfffb5 MANIFEST
-SHA1 4efed966d43e74a6f53ef2bcdbfc4de05b92035f META.yml
-SHA1 e111caf8b7da35935fa7004a17045cab55278445 Makefile.PL
-SHA1 80cff3b1f65e7df95eaa1a992b688c2c5e1d2b6e README
-SHA1 5ca10e18e888daf0883de553219f42ca2422763f lib/Date/Format.pm
-SHA1 08342e72298e839f21236dff7555f2505f928d32 lib/Date/Language.pm
-SHA1 50703aeade60a04398517416d30a2d8918c95578 lib/Date/Language/Afar.pm
-SHA1 f9450ca0047510a4102c32cc4e20a435cdd85b31 lib/Date/Language/Amharic.pm
-SHA1 f00534703736026830f729445d0d6f582481a05e lib/Date/Language/Austrian.pm
-SHA1 c5af5f819bbd3eff3b404e62f1a3735d7e4a038b lib/Date/Language/Brazilian.pm
-SHA1 e89738e9f3611a6de79cef7e791c20a05ac2a057 lib/Date/Language/Chinese.pm
-SHA1 d8765df8f8368d6b467a87b1f32397d50253747a lib/Date/Language/Chinese_GB.pm
-SHA1 f5061baf9b980aa0e8feefab059214775bb8182e lib/Date/Language/Czech.pm
-SHA1 726c12ddd66f70ddcfd5bbdbc094777255eb2b9b lib/Date/Language/Danish.pm
-SHA1 8566be869607c2b2024821def260de5a828f005f lib/Date/Language/Dutch.pm
-SHA1 ab20e0b3487b85a54a3d6321b50d01d43fe78427 lib/Date/Language/English.pm
-SHA1 9b057eea719ed24f643f4d284cf1fa6ae594e7dc lib/Date/Language/Finnish.pm
-SHA1 105169f2848df40ac1111f0130ec1bb4b74647d8 lib/Date/Language/French.pm
-SHA1 dc2f9c1cee48be3b73613ca9ed1291e9c976a37e lib/Date/Language/Gedeo.pm
-SHA1 794a9b715e66fdcc428a65b2972ced4fee62b52c lib/Date/Language/German.pm
-SHA1 863bb62fd08b3e61c63a2df3d65323d8e6c1b651 lib/Date/Language/Greek.pm
-SHA1 8f0678fee75492f3675cf0b130fd39c7a589a552 lib/Date/Language/Hungarian.pm
-SHA1 34da50806290fe731fd1e01290728fcd0b6d02a2 lib/Date/Language/Icelandic.pm
-SHA1 de5069f424fed480586bc2dcff1cca1930bf98a1 lib/Date/Language/Italian.pm
-SHA1 e4e81280ba513a3ab6e0bee01704913dd730c9a8 lib/Date/Language/Norwegian.pm
-SHA1 13165e5b72586200a106aa2870fe92b49d94dd8c lib/Date/Language/Oromo.pm
-SHA1 71eaea1d32b8fcfa23c5a815e3fa54b9f84af80c lib/Date/Language/Romanian.pm
-SHA1 806f38e0789bf10f2e843c69f68bcfa50c0d78eb lib/Date/Language/Russian.pm
-SHA1 292c36c93532a57b667d7deedc23cefbb9bf478c lib/Date/Language/Russian_cp1251.pm
-SHA1 26efbebc7afd065da56ec09ee3b062a9ddd4a2d3 lib/Date/Language/Russian_koi8r.pm
-SHA1 d1658daedcf106f01869a4371b9c3e572330f864 lib/Date/Language/Sidama.pm
-SHA1 58f9ded75fc18c26eeb96ce6374e66565ad01494 lib/Date/Language/Somali.pm
-SHA1 8b970f347eb0718e210d7613db5ba88b124d189e lib/Date/Language/Spanish.pm
-SHA1 a52f8968a0fdf3e735d62f71b91d6b64a5f98fa3 lib/Date/Language/Swedish.pm
-SHA1 5da829cf39dc01331ad58f66eced0a1f47e346b6 lib/Date/Language/Tigrinya.pm
-SHA1 20fc6beb32657ca147719f713ff816bbb696da20 lib/Date/Language/TigrinyaEritrean.pm
-SHA1 30f77a43a000f2ce3d22b1b633261a20289025aa lib/Date/Language/TigrinyaEthiopian.pm
-SHA1 54288741c52b09ee92b0487848df74a08cdc3b9e lib/Date/Language/Turkish.pm
-SHA1 b10ec48bd01b73638e4c6dce3f554e4c77267b6c lib/Date/Parse.pm
-SHA1 394c7d372c25107ba5151ceca44c0599188907c7 lib/Time/Zone.pm
-SHA1 ee65cf5b634d907c4cc2d414e49c06175461e6ac t/cpanrt.t
-SHA1 7b16580497a96a4bc551b87b8b97ec89331e81f8 t/date.t
-SHA1 bf6f4a7c599485ab11779c99fc821378e547d26d t/format.t
-SHA1 acef4dd152cd391a3e7a7945c8405a50d965f335 t/getdate.t
-SHA1 501dcb487e33f6b2d4577ef2e6e5f67f038d3c04 t/lang.t
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.10 (Darwin)
-
-iEYEARECAAYFAksjjt4ACgkQR0BL4gbYw3RCKgCePxf2QrH/3uvOofKewESV0zto
-t+sAnA5dGEi945ziAfAkLyFUhIMWnm7U
-=GqfE
------END PGP SIGNATURE-----
diff --git a/lib/Date/Language.pm b/lib/Date/Language.pm
index 229a1c0..02a05e7 100644
--- a/lib/Date/Language.pm
+++ b/lib/Date/Language.pm
@@ -110,7 +110,7 @@ L<Date::Language> provides objects to parse and format dates for specific langua
Danish Norwegian TigrinyaEritrean
Dutch Oromo TigrinyaEthiopian
English Romanian Turkish
- Finnish Russian
+ Finnish Russian Bulgarian
=head1 METHODS
diff --git a/lib/Date/Language/Bulgarian.pm b/lib/Date/Language/Bulgarian.pm
new file mode 100644
index 0000000..cf3d127
--- /dev/null
+++ b/lib/Date/Language/Bulgarian.pm
@@ -0,0 +1,92 @@
+##
+## Bulgarian tables contributed by Krasimir Berov
+##
+
+package Date::Language::Bulgarian;
+use strict;
+use warnings;
+use utf8;
+use base qw(Date::Language);
+our (@DoW, @DoWs, @MoY, @MoYs, @AMPM, @Dsuf, %MoY, %DoW, $VERSION);
+$VERSION = "1.01";
+
+@DoW = qw(неделя понеделник вторник сряда четвъртък петък събота);
+@MoY = qw(януари февруари март април май юни
+ юли август септември октомври ноември декември);
+@DoWs = qw(нд пн вт ср чт пт сб);
+@MoYs = map { substr($_,0,3) } @MoY;
+@AMPM = qw(AM PM);
+
+@Dsuf = (qw(ти ви ри ти ти ти ти ми ми ти)) x 3;
+@Dsuf[11,12,13] = qw(ти ти ти);
+@Dsuf[30,31] = qw(ти ви);
+
+@MoY{@MoY} = (0 .. scalar(@MoY));
+@MoY{@MoYs} = (0 .. scalar(@MoYs));
+@DoW{@DoW} = (0 .. scalar(@DoW));
+@DoW{@DoWs} = (0 .. scalar(@DoWs));
+
+# Formatting routines
+
+sub format_a { $DoWs[$_[0]->[6]] }
+sub format_A { $DoW[$_[0]->[6]] }
+sub format_b { $MoYs[$_[0]->[4]] }
+sub format_B { $MoY[$_[0]->[4]] }
+sub format_h { $MoYs[$_[0]->[4]] }
+sub format_p { $_[0]->[2] >= 12 ? $AMPM[1] : $AMPM[0] }
+sub format_o { ($_[0]->[3]<10?' ':'').$_[0]->[3].$Dsuf[$_[0]->[3]] }
+
+1;
+
+__END__
+
+=encoding utf8
+
+=head1 NAME
+
+Date::Language::Bulgarian - localization for Date::Format
+
+=head1 DESCRIPTION
+
+This is Bulgarian localization for Date::Format.
+It is important to note that this module source code is in utf8.
+All strings which it outputs are in utf8, so it is safe to use it
+currently only with English. You are left alone to try and convert
+the output when using different Date::Language::* in the same application.
+This should be addresed in the future.
+
+=head1 SYNOPSIS
+
+ use strict;
+ use warnings;
+ use Date::Language;
+ local $\=$/;
+ my $template ='%a %b %e %T %Y (%Y-%m-%d %H:%M:%S)';
+ my $time=1290883821; #or just use time();
+ my @lt = localtime($time);
+ my %languages = qw(English GMT German EEST Bulgarian EET);
+ binmode(select,':utf8');
+
+ foreach my $l(keys %languages){
+ my $lang = Date::Language->new($l);
+ my $zone = $languages{$l};
+ print $/. "$l $zone";
+ print $lang->time2str($template, $time);
+ print $lang->time2str($template, $time, $zone);
+
+ print $lang->strftime($template, \@lt);
+ }
+
+=head1 AUTHOR
+
+Krasimir Berov (berov@cpan.org)
+
+=head1 COPYRIGHT
+
+Copyright (c) 2010 Krasimir Berov. This program is free
+software; you can redistribute it and/or modify it under the same terms
+as Perl itself.
+
+=cut
+
+
diff --git a/t/format.t b/t/format.t
index 15765c2..f6cbf58 100644
--- a/t/format.t
+++ b/t/format.t
@@ -1,13 +1,9 @@
-
+use Test::More tests => 202;
use Date::Format qw(ctime time2str);
use Date::Language;
-
-print "1..152\n";
-
-my $i = 1;
-
+use utf8;
+my ($pkg, $t,$language);
$pkg = 'Date::Format::Generic';
-
while(<DATA>) {
chomp;
if (/^(\d+)/) {
@@ -15,14 +11,14 @@ while(<DATA>) {
next;
}
elsif (/^(\w+)/) {
- $pkg = Date::Language->new($1);
+ $language = $1;
+ $pkg = Date::Language->new($language);
next;
}
my($fmt,$res) = split(/\t+/,$_);
my $str = $pkg->time2str($fmt,$t,'GMT');
- print "# '$fmt'$res'$str'\nnot " unless $str eq $res;
- print "ok ",$i++,"\n";
+ is($str, $res,"$fmt");
}
__DATA__
@@ -180,5 +176,57 @@ Italian
%Oq III
%OY MCMXCIX
%Oy XCIX
-316051200 # Mon Jan 7 00:00:00 1980 GMT
-%G 0
+316648800 # Wed Jan 14 00:00:00 1980
+%G 1 #0 is interpreted as empty string
+Bulgarian
+1283926923 # ср сеп 8 09:22:03 EET 2010 /Tue Sep 06:22:03 GMT 2010
+%y 10
+%Y 2010
+%% %
+%a ср
+%A сряда
+%b сеп
+%B септември
+%c 09/08/10 06:22:03
+%C ср сеп 8 06:22:03 GMT 2010
+%d 08
+%e 8
+%D 09/08/10
+%G 1600
+%h сеп
+%H 06
+%I 06
+%j 251
+%k 6
+%l 6
+%L 9
+%m 09
+%M 22
+%o 8ми
+%p AM
+%q 3
+%r 06:22:03 AM
+%R 06:22
+%s 1283926923
+%S 03
+%T 06:22:03
+%U 36
+%w 3
+%W 36
+%x 09/08/10
+%X 06:22:03
+%Z GMT
+%z +0000
+%z +0000
+%Od VIII
+%Oe VIII
+%OH VI
+%OI VI
+%Oj CCLI
+%Ok VI
+%Ol VI
+%Om IX
+%OM XXII
+%Oq III
+%OY MMX
+%Oy X
diff --git a/t/lang.t b/t/lang.t
index 02c96f4..75bac66 100644
--- a/t/lang.t
+++ b/t/lang.t
@@ -6,7 +6,7 @@ use Date::Language;
my $time = time;
my $v;
-my @lang = qw(English German Italian);
+my @lang = qw(English German Italian Bulgarian);
print "1..", scalar(@lang),"\n";