PGObject-Type-DateTime-2.000002/0000755000175000017500000000000013540744501017066 5ustar ehuelsmannehuelsmannPGObject-Type-DateTime-2.000002/ignore.txt0000644000175000017500000000020413540744026021110 0ustar ehuelsmannehuelsmannblib* Makefile Makefile.old Build Build.bat _build* pm_to_blib* *.tar.gz .lwpcookies cover_db pod2htm*.tmp PGObject-Type-DateTime-* PGObject-Type-DateTime-2.000002/MANIFEST0000644000175000017500000000063113540744501020217 0ustar ehuelsmannehuelsmannChanges ignore.txt lib/PGObject/Type/DateTime.pm LICENSE Makefile.PL MANIFEST README README.md t/00-load.t t/01-constructor.t t/02-registration.t t/03-dbtests.t t/04-overloaded.t t/boilerplate.t t/manifest.t t/pod-coverage.t t/pod.t testlog META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) PGObject-Type-DateTime-2.000002/Makefile.PL0000644000175000017500000000214613540744072021046 0ustar ehuelsmannehuelsmannuse 5.010; use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'PGObject::Type::DateTime', AUTHOR => q{Chris Travers }, VERSION_FROM => 'lib/PGObject/Type/DateTime.pm', ABSTRACT_FROM => 'lib/PGObject/Type/DateTime.pm', ($ExtUtils::MakeMaker::VERSION >= 6.3002 ? ('LICENSE'=> 'BSD') : ()), PL_FILES => {}, PREREQ_PM => { 'PGObject' => '1.3', 'DateTime' => '1.05', # 'local_week' was added in 1.05 'DateTime::TimeZone' => 0, }, BUILD_REQUIRES => { 'Test::More' => 0, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'PGObject-Type-DateTime-*' }, META_MERGE => { 'meta-spec' => { version => 2 }, resources => { repository => { type => 'git', url => 'https://github.com/ledgersmb/PGObject-Type-DateTime.git', web => 'https://github.com/ledgersmb/PGObject-Type-DateTime', }, }, }, ); PGObject-Type-DateTime-2.000002/lib/0000755000175000017500000000000013540744500017633 5ustar ehuelsmannehuelsmannPGObject-Type-DateTime-2.000002/lib/PGObject/0000755000175000017500000000000013540744500021270 5ustar ehuelsmannehuelsmannPGObject-Type-DateTime-2.000002/lib/PGObject/Type/0000755000175000017500000000000013540744500022211 5ustar ehuelsmannehuelsmannPGObject-Type-DateTime-2.000002/lib/PGObject/Type/DateTime.pm0000644000175000017500000002050713540744372024256 0ustar ehuelsmannehuelsmannpackage PGObject::Type::DateTime; use 5.010; use Carp; use strict; use warnings; use base qw(DateTime); use DateTime::TimeZone; use PGObject; =head1 NAME PGObject::Type::DateTime - DateTime Wrappers for PGObject =head1 VERSION Version 2.0.2 =cut our $VERSION = 2.000002; our $default_tz = DateTime::TimeZone->new(name => 'UTC'); =head1 SYNOPSIS PGObject::Type::DateTime->register(); Now all Datetime, Timestamp, and TimestampTZ types are returned returned as datetime objects. Date and time modules may require subclasses to serialize properly to the database. =head1 ONGOING WORK IN 2.X During the 2.x series we expect to work on better NULL support. Right now this is all delegated to clild classes, but there are likely to be cases where we add this to our library directly. =head1 DESCRIPTION This module provides a basic wrapper around DateTime to allow PGObject-framework types to automatically tie date/time related objects, but we handle date and timestamp formats in our from_db routines. This specific module only supports the ISO YMD datestyle. The MDY or DMY datestyles may be usable in future versions but datestyles other than ISO raise ambiguity issues, sufficient that they cannot always even be used in PostgreSQL as input. This module also provides basic default handling. Times are assigned a date of '0001-01-01' and dates are assigned a time of midnight. Whether this is set is persisted, along with whether timezones are set, and these are returned to a valid ISO YMD format on export, if a date component was initially set. This means you can use this for general math without worrying about many of the other nicities. Parsing ISO YMD dates and standard times (24 hr format) is supported via the from_db interface, which also provides a useful way of handing dates in. =head1 SUBROUTINES/METHODS =head2 register By default registers 'date', 'time', 'timestamp', and 'timestamptz' =cut sub register { my $self = shift @_; croak "Can't pass reference to register \n". "Hint: use the class instead of the object" if ref $self; my %args = @_; my $registry = $args{registry}; $registry ||= 'default'; my $types = $args{types}; $types = ['date', 'time', 'timestamp', 'timestamptz'] unless defined $types and @$types; for my $type (@$types){ if ($PGObject::VERSION =~ /^1\./) { # 1.x my $ret = PGObject->register_type(registry => $registry, pg_type => $type, perl_class => $self); } else { # higher than 1.x require PGObject::Type::Registry; PGObject::Type::Registry->register_type( registry => $registry, dbtype => $type, apptype => $self ); } } return 1; } =head2 _new Constructor for the PGDate object. Fully compliant with DateTime C<_new> constructor which it uses internally to instantiate objects. We need to hook this constructor instead of the regular C one, because this one is referred to directly on numerous occasions. =cut sub _new { my $class = shift; my (%args) = @_; my $self = $class->SUPER::_new(@_); bless $self, $class; $self->{_pgobject_is_date} = (defined $args{year} && $args{year} > 1) ? 1 : 0; $self->{_pgobject_is_time} = (defined $args{hour}) ? 1 : 0; $self->{_pgobject_is_tz} = (defined $args{time_zone}) ? 1 : 0; return $self; } =head2 today Wraps C, clearing the internal flag which causes C to return a non-false value. =cut sub today { my $class = shift; my $self = $class->SUPER::today(@_); $self->{_pgobject_is_time} = 0; return $self; } =head2 last_day_of_month Wraps C, clearing the internal flag which causes C to return a non-false value. =cut sub last_day_of_month { my $class = shift; my $self = $class->SUPER::last_day_of_month(@_); $self->{_pgobject_is_time} = 0; return $self; } =head2 from_day_of_year Wraps C, clearing the internal flag which causes C to return a non-false value. =cut sub from_day_of_year { my $class = shift; my $self = $class->SUPER::from_day_of_year(@_); $self->{_pgobject_is_time} = 0; return $self; } =head2 truncate( to => ... ) Wraps C, clearing the internal flag which causes C to return a non-false value, if the C argument is not one of C, C or C. =cut sub truncate { my $class = shift; my %args = @_; my $self = $class->SUPER::truncate(@_); $self->{_pgobject_is_time} = 0 if ! grep { $args{to} eq $_} qw/ hour minute second /; return $self; } =head2 from_db Parses a date from YYYY-MM-DD format and generates the new object based on it. =cut sub from_db { my ($class, $value) = @_; my ($year, $month, $day, $hour, $min, $sec, $nanosec, $tz); $value = '' if not defined $value; $value =~ /(\d{4})-(\d{2})-(\d{2})/ and ($year, $month, $day) = ($1, $2, $3); $value =~ /(\d+):(\d+):([0-9.]+)([+-]\d{1,4})?/ and ($hour, $min, $sec, $tz) = ($1, $2, $3, $4); $tz ||= $default_tz; # defaults to UTC $tz .= '00' if $tz =~ /([+-]\d{2}$)/; ($sec, $nanosec) = split /\./, $sec if $sec; $nanosec *= 1000 if $nanosec; my $self = "$class"->new( year => $year || 1, month => $month || 1, day => $day || 1, hour => $hour || 0, minute => $min || 0, second => $sec || 0, nanosecond => $nanosec || 0, time_zone => $tz || 0, ); $self->is_time(0) if ! defined $hour; $self->is_tz(0) if $tz == $default_tz; return $self; } =head2 to_db Returns the date in YYYY-MM-DD format. =cut sub to_db { my ($self) = @_; return undef unless ($self->is_date or $self->is_time); my $dbst = ''; my $offset = $self->offset; $offset = $offset / 60; my $offset_min = $offset%60; $offset = $offset / 60; my $sign = ($offset > 0)? '+' : '-'; $offset = $sign . sprintf('%02d', abs($offset)); if ($offset_min){ $offset = "$offset$offset_min"; } $dbst .= $self->ymd if $self->is_date; $dbst .= ' ' if $self->is_date and $self->is_time; $dbst .= $self->hms . '.' . $self->microsecond if $self->is_time; $dbst .= $offset if $self->time_zone ne $default_tz and $self->is_time; return $dbst; } =head2 is_date($to_set) If $to_set is set, sets this. In both cases, returns whether the object is now a date. =cut sub is_date { my ($self, $val) = @_; if (defined $val){ $self->{_pgobject_is_date} = $val; } return $self->{_pgobject_is_date}; } =head2 is_time($to_set) If $to_set is set, sets this. In both cases, returns whether the object is now a time. =cut sub is_time { my ($self, $val) = @_; if (defined $val){ $self->{_pgobject_is_time} = $val; } return $self->{_pgobject_is_time}; } =head2 is_tz($to_set) If $to_set is set, sets this. In both cases, returns whether the object is now a date. =cut sub is_tz { my ($self, $val) = @_; if (defined $val){ $self->{_pgobject_is_tz} = $val; } return $self->{_pgobject_is_tz}; } =head1 AUTHOR Chris Travers, C<< >> =head1 BUGS Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT You can find documentation for this module with the perldoc command. perldoc PGObject::Type::DateTime You can also look for information at: =over 4 =item * RT: CPAN's request tracker (report bugs here) L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =item * Search CPAN L =back =head1 ACKNOWLEDGEMENTS =head1 LICENSE AND COPYRIGHT Copyright 2013-2017 The LedgerSMB Core Team This program is released under the following license: BSD =cut 1; # End of PGObject::Type::DateTime PGObject-Type-DateTime-2.000002/META.yml0000664000175000017500000000126713540744500020346 0ustar ehuelsmannehuelsmann--- abstract: 'DateTime Wrappers for PGObject' author: - 'Chris Travers ' build_requires: Test::More: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.1002, CPAN::Meta::Converter version 2.150005' license: bsd meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: PGObject-Type-DateTime no_index: directory: - t - inc requires: DateTime: '1.05' DateTime::TimeZone: '0' PGObject: '1.3' resources: repository: https://github.com/ledgersmb/PGObject-Type-DateTime.git version: 2.000002 x_serialization_backend: 'CPAN::Meta::YAML version 0.018' PGObject-Type-DateTime-2.000002/t/0000755000175000017500000000000013540744500017330 5ustar ehuelsmannehuelsmannPGObject-Type-DateTime-2.000002/t/01-constructor.t0000644000175000017500000000411113540744026022320 0ustar ehuelsmannehuelsmannuse PGObject::Type::DateTime; use Test::More tests => 26; my $test; $test = PGObject::Type::DateTime->from_db("2013-12-11 11:11:11.11234-08"); isa_ok $test, 'DateTime', 'long parse, isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'long parse, is expected class'; is $test->to_db, "2013-12-11 11:11:11.11234-08", 'long parse, expected db out'; ok $test->is_tz, 'long parse, timezone'; $test = PGObject::Type::DateTime->from_db('2012-12-11'); isa_ok $test, 'DateTime', 'date only, isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'date only, is expected class'; is $test->to_db, "2012-12-11", 'date only, expected db out'; is $test->is_tz, 0, 'date only, no timezone'; $test = PGObject::Type::DateTime->from_db('11:11:23.1111'); isa_ok $test, 'DateTime', 'time only, isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'time only, is expected class'; is $test->to_db, "11:11:23.1111", 'long parse, expected db out'; is $test->is_tz, 0, 'time only, no timezone'; $test = PGObject::Type::DateTime->from_db("2013-12-11 00:00:00.0000-08"); isa_ok $test, 'DateTime', 'Midnight, isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'Midnight. is expected class'; is $test->to_db, "2013-12-11 00:00:00.0-08", 'Midnight, expected db out'; ok $test->is_tz, 'Midnight, timezone'; $test = PGObject::Type::DateTime->from_db("2013-12-11 00:00:00.0000"); isa_ok $test, 'DateTime', 'Midnight, no time zone, isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'Midnight. is expected class'; is $test->to_db, "2013-12-11 00:00:00.0", 'Midnight, expected db out'; is $test->is_tz, 0, 'Midnight, timezone'; $test = PGObject::Type::DateTime->from_db("2013-12-11 00:00:00.0000+08"); isa_ok $test, 'DateTime', 'Midnight, positive offset, isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'Midnight positive offset. is expected class'; is $test->to_db, "2013-12-11 00:00:00.0+08", 'Midnight positive offset, expected db out'; ok $test->is_tz, 'Midnight, positive offset, timezone'; $test = PGObject::Type::DateTime->from_db(undef); isa_ok $test, 'DateTime', 'undef'; is $test->to_db, undef; PGObject-Type-DateTime-2.000002/t/boilerplate.t0000644000175000017500000000237113540744026022025 0ustar ehuelsmannehuelsmann#!perl -T use 5.006; use strict; use warnings; use Test::More tests => 3; sub not_in_file_ok { my ($filename, %regex) = @_; open( my $fh, '<', $filename ) or die "couldn't open $filename for reading: $!"; my %violated; while (my $line = <$fh>) { while (my ($desc, $regex) = each %regex) { if ($line =~ $regex) { push @{$violated{$desc}||=[]}, $.; } } } if (%violated) { fail("$filename contains boilerplate text"); diag "$_ appears on lines @{$violated{$_}}" for keys %violated; } else { pass("$filename contains no boilerplate text"); } } sub module_boilerplate_ok { my ($module) = @_; not_in_file_ok($module => 'the great new $MODULENAME' => qr/ - The great new /, 'boilerplate description' => qr/Quick summary of what the module/, 'stub function definition' => qr/function[12]/, ); } not_in_file_ok(README => "The README is used..." => qr/The README is used/, "'version information here'" => qr/to provide version information/, ); not_in_file_ok(Changes => "placeholder date/time" => qr(Date/time) ); module_boilerplate_ok('lib/PGObject/Type/DateTime.pm'); PGObject-Type-DateTime-2.000002/t/04-overloaded.t0000644000175000017500000000314613540744026022071 0ustar ehuelsmannehuelsmann#!perl use PGObject::Type::DateTime; use Test::More tests => 33; my $test; $test = PGObject::Type::DateTime->today; isa_ok $test, 'DateTime', 'overloaded today(), isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'overloaded today(), is expected class'; like $test->to_db, qr/^\d{4}-\d{2}-\d{2}$/, 'overloaded today() returns a date only'; for my $trunc (qw/ year month week local_week day/) { $test = PGObject::Type::DateTime->now->truncate( to => $trunc ); isa_ok $test, 'DateTime', 'truncate (no time), isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'truncate (no time), is expected class'; ok(! $test->is_time, 'truncate (no time), has no time'); } for my $trunc (qw/ hour minute second /) { $test = PGObject::Type::DateTime->now->truncate( to => $trunc ); isa_ok $test, 'DateTime', 'truncate (with time), isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'truncate (with time), is expected class'; ok($test->is_time, 'truncate (with time), has time'); } $test = PGObject::Type::DateTime->last_day_of_month(year => 2015, month => 12); isa_ok $test, 'DateTime', 'last_day_of_month, isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'last_day_of_month, is expected class'; ok ! $test->is_time, 'last_day_of_month has no time'; $test = PGObject::Type::DateTime->from_day_of_year(year => 2015, day_of_year => 150); isa_ok $test, 'DateTime', 'from_day_of_year, isa date time'; isa_ok $test, 'PGObject::Type::DateTime', 'from_day_of_year, is expected class'; ok ! $test->is_time, 'from_day_of_year has no time'; PGObject-Type-DateTime-2.000002/t/00-load.t0000644000175000017500000000032013540744026020647 0ustar ehuelsmannehuelsmann#!perl -T use Test::More tests => 1; BEGIN { use_ok( 'PGObject::Type::DateTime' ) || print "Bail out!\n"; } diag( "Testing PGObject::Type::DateTime $PGObject::Type::DateTime::VERSION, Perl $], $^X" ); PGObject-Type-DateTime-2.000002/t/02-registration.t0000644000175000017500000000272013540744026022452 0ustar ehuelsmannehuelsmann use Test::More tests => 15; use PGObject; use PGObject::Type::DateTime; use strict; use warnings; use Data::Dumper; no strict 'refs'; diag Dumper(\%{"::PGObject::Type::"}); # Theoretically we could grab ints as well, and this makes a nice test case. # The tests here are: # 1. Registration with the default registry, default types # 2. Registration with the default registry, int8 type # 3. Registration with custom registry 'test', int8 type # 4. Registration with custom registry 'test', default types # 5. Registry properly lists all appropriate types. ok(PGObject->new_registry('test'), 'creating test registry'); ok(PGObject::Type::DateTime->register(), 'default registration'); ok(PGObject::Type::DateTime->register(types => ['mytime']), 'mytime registration'); ok(PGObject::Type::DateTime->register(registry => 'test', types => ['mytime']), 'custom registry, mytime registration'), ok(PGObject::Type::DateTime->register(registry => 'test'), 'default types, custom registry'); my $registry; if ($PGObject::VERSION =~ /^1\./){ $registry = PGObject::get_type_registry(); } else { $registry = { map {$_ => PGObject::Type::Registry->inspect($_) } qw(test default) } ; } for my $reg(qw(default test)){ for my $type (qw(date time timestamp timestamptz mytime)) { is($registry->{$reg}->{$type}, 'PGObject::Type::DateTime', "registry $reg, type $type correctly registered"); } } PGObject-Type-DateTime-2.000002/t/pod-coverage.t0000644000175000017500000000104713540744026022075 0ustar ehuelsmannehuelsmannuse strict; use warnings; use Test::More; # Ensure a recent version of Test::Pod::Coverage my $min_tpc = 1.08; eval "use Test::Pod::Coverage $min_tpc"; plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" if $@; # Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, # but older versions don't recognize some common documentation styles my $min_pc = 0.18; eval "use Pod::Coverage $min_pc"; plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" if $@; all_pod_coverage_ok(); PGObject-Type-DateTime-2.000002/t/manifest.t0000644000175000017500000000042013540744026021322 0ustar ehuelsmannehuelsmann#!perl -T use strict; use warnings; use Test::More; unless ( $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } eval "use Test::CheckManifest 0.9"; plan skip_all => "Test::CheckManifest 0.9 required" if $@; ok_manifest(); PGObject-Type-DateTime-2.000002/t/pod.t0000644000175000017500000000035013540744026020300 0ustar ehuelsmannehuelsmann#!perl -T use strict; use warnings; use Test::More; # Ensure a recent version of Test::Pod my $min_tp = 1.22; eval "use Test::Pod $min_tp"; plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; all_pod_files_ok(); PGObject-Type-DateTime-2.000002/t/03-dbtests.t0000644000175000017500000000521513540744026021413 0ustar ehuelsmannehuelsmannuse Test::More; use DBI; use PGObject; use PGObject::Type::DateTime; PGObject::Type::DateTime->register(); my $functions = { time => q| create or replace function test__time() returns time language sql as $$SELECT '11:11:11.00'::time;$$|, date => q| create or replace function test__date() returns date language sql as $$SELECT '2012-11-01'::date;$$|, timestamp => q| create or replace function test__timestamp() returns timestamp language sql as $$SELECT '2012-01-01 11:11:11.00'::timestamp;$$|, timestamptz => q| create or replace function test__timestamptz() returns timestamptz language sql as $$SELECT '2012-01-01 11:11:11.00-8'::timestamptz;$$|, round_trip => ' create or replace function test__roundtrip(date) returns date language sql as $$SELECT $1;$$', }; plan skip_all => 'Not set up for dbtests' unless $ENV{DB_TESTING}; # DB Setup my $predbh = DBI->connect('dbi:Pg:', 'postgres'); plan skip_all => "Could not get superuser access to db. skipping" unless $predbh; $predbh->do('CREATE DATABASE test_pgobject_type_datetime'); my $dbh = DBI->connect('dbi:Pg:dbname=test_pgobject_type_datetime'); for my $fnc (keys %$functions){ $dbh->do($functions->{$fnc}); } # Planning if ($dbh) { plan tests => 11; } else { plan skipall => "No database connection, or connection failed"; } # Test cases for my $type (qw(date time timestamp timestamptz)){ my ($ref) = PGObject->call_procedure( funcname => $type, funcprefix => 'test__', args => [], dbh => $dbh, ); my ($val) = values %$ref; ok(eval {$val->isa('DateTime')}, "Type $type returns DateTime object"); ok(eval {$val->isa('PGObject::Type::DateTime')}, "Type $type returns PGObject::Type::DateTime object"); } my $orig = '2012-01-01'; my $val = PGObject::Type::DateTime->from_db($orig); my ($ref) = PGObject->call_procedure( funcname => 'roundtrip', funcprefix => 'test__', args => [$val], dbh => $dbh, ); ($val) = values %$ref; ok(eval {$val->isa('DateTime')}, "Roundtrip returns DateTime object"); ok(eval {$val->isa('PGObject::Type::DateTime')}, "Roundtrip returns PGObject::Type::DateTime object"); is(eval {$val->to_db}, $orig, 'Round Trip returns same value sent'); # DB Cleanup $dbh->disconnect; $predbh->do('DROP DATABASE test_pgobject_type_datetime'); PGObject-Type-DateTime-2.000002/README.md0000644000175000017500000000220713540744026020350 0ustar ehuelsmannehuelsmannPGObject-Type-DateTime This module provides a general wrapper for Perl DateTime objects for PostgreSQL date and time values. Once it is registered, it returns DateTime objects (via this wrapper class) which can be automatically serialized into PostgreSQL date and time values. Whether to print date and time is persisted and stored. INSTALLATION To install this module, run the following commands: perl Makefile.PL make make test make install SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc PGObject::Type::DateTime You can also look for information at: RT, CPAN's request tracker (report bugs here) http://rt.cpan.org/NoAuth/Bugs.html?Dist=PGObject-Type-DateTime AnnoCPAN, Annotated CPAN documentation http://annocpan.org/dist/PGObject-Type-DateTime CPAN Ratings http://cpanratings.perl.org/d/PGObject-Type-DateTime Search CPAN http://search.cpan.org/dist/PGObject-Type-DateTime/ LICENSE AND COPYRIGHT Copyright (C) 2013-2017 The LedgerSMB Core Team This program is released under the following license: BSD PGObject-Type-DateTime-2.000002/README0000644000175000017500000000217513540744026017755 0ustar ehuelsmannehuelsmannPGObject-Type-DateTime This module provides a general wrapper for Perl DateTime objects for PostgreSQL date and time values. Once it is registered, it returns DateTime objects (via this wrapper class) which can be automatically serialized into PostgreSQL date and time values. Whether to print date and time is persisted and stored. INSTALLATION To install this module, run the following commands: perl Makefile.PL make make test make install SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc PGObject::Type::DateTime You can also look for information at: RT, CPAN's request tracker (report bugs here) http://rt.cpan.org/NoAuth/Bugs.html?Dist=PGObject-Type-DateTime AnnoCPAN, Annotated CPAN documentation http://annocpan.org/dist/PGObject-Type-DateTime CPAN Ratings http://cpanratings.perl.org/d/PGObject-Type-DateTime Search CPAN http://search.cpan.org/dist/PGObject-Type-DateTime/ LICENSE AND COPYRIGHT Copyright (C) 2013-2017 Chris Travers This program is released under the following license: BSD PGObject-Type-DateTime-2.000002/LICENSE0000644000175000017500000000243213540744026020076 0ustar ehuelsmannehuelsmannCopyright (c) 2013, The LedgerSMB Core Team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PGObject-Type-DateTime-2.000002/META.json0000664000175000017500000000234213540744501020512 0ustar ehuelsmannehuelsmann{ "abstract" : "DateTime Wrappers for PGObject", "author" : [ "Chris Travers " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.1002, CPAN::Meta::Converter version 2.150005", "license" : [ "bsd" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "PGObject-Type-DateTime", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "Test::More" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "DateTime" : "1.05", "DateTime::TimeZone" : "0", "PGObject" : "1.3" } } }, "release_status" : "stable", "resources" : { "repository" : { "type" : "git", "url" : "https://github.com/ledgersmb/PGObject-Type-DateTime.git", "web" : "https://github.com/ledgersmb/PGObject-Type-DateTime" } }, "version" : 2.000002, "x_serialization_backend" : "JSON::PP version 2.27300_01" } PGObject-Type-DateTime-2.000002/Changes0000644000175000017500000000212113540744350020357 0ustar ehuelsmannehuelsmannRevision history for PGObject-Type-DateTime 2.0.2 2019-09-19 Set minimum DateTime dependency to 1.05 (found by cpantesters) 2.0.1 2017-08-14 Fix regex for PGObject 1 vs 2 detection 2.0.0 2017-05-17 Support for PGObject 2.0 Min Perl version is now 5.10 1.0.5 2016-12-13 Add indicator for timezone 1.0.4 2016-07-09 Override DateTime methods which clearly return a date-value (i.e. today(), last_day_of_month() and from_day_of_year()) to clear the 'is_time' flag. Instead of overriding 'new()', override '_new()' which DateTime uses internally to create instances, the real constructor. 1.0.3 2016-04-21 Set 'is_date' and 'is_time' flags in 'new()' instead of our specialized to_/from_db() methods 1.0.2 2014-09-10 Minor doc fixes 1.00.001 2014-02-22 Adjusted the Makefile.PL to provide explicit dependency for DateTime::TimeZone 1.00 2014-02-20 Added NULL handling Added subclassing support 0.01 2013-11-13 First version, released on an unsuspecting world.