package Reaction::Types::DateTime;
use MooseX::Types
- -declare => [qw/DateTime SpanSet TimeRangeCollection/];
+ -declare => [qw/DateTimeObject SpanSet TimeRangeCollection/];
use MooseX::Types::Moose qw/Object ArrayRef/;
use DateTime;
-subtype DateTime,
+subtype DateTimeObject,
as Object,
where { $_->isa('DateTime') },
message { "Must be of the form YYYY-MM-DD HH:MM:SS" };
$self->_build_simple_field(attribute => $attr, class => Password, %$args);
};
- implements _build_fields_for_type_Reaction_Types_DateTime_DateTime => as {
+ implements _build_fields_for_type_Reaction_Types_DateTime_DateTimeObject => as {
my ($self, $attr, $args) = @_;
$self->_build_simple_field(attribute => $attr, class => DateTime, %$args);
};
$_[0]->(@_[1,2], { layout => 'value/string', %{ $_[3] || {} } })
};
- around _build_fields_for_type_Reaction_Types_DateTime_DateTime => sub {
+ around _build_fields_for_type_Reaction_Types_DateTime_DateTimeObject => sub {
$_[0]->(@_[1,2], { layout => 'value/date_time', %{ $_[3] || {} } })
};
use Scalar::Util 'blessed';
use Reaction::Class;
-use Reaction::Types::DateTime;
+use Reaction::Types::DateTime 'DateTimeObject';
use aliased 'Reaction::UI::ViewPort::Field';
class DateTime is Field, which {
- has '+value' => (isa => DateTime);
+ has '+value' => (isa => DateTimeObject);
has value_string_default_format => (
isa => 'Str', is => 'rw', required => 1, default => sub { "%F %H:%M:%S" }
$self->_build_simple_field(attribute => $attr, class => String, %$args);
};
- implements _build_fields_for_type_Reaction_Types_DateTime_DateTime => as {
+ implements _build_fields_for_type_Reaction_Types_DateTime_DateTimeObject => as {
my ($self, $attr, $args) = @_;
$self->_build_simple_field(attribute => $attr, class => DateTime, %$args);
};
use base qw/DBIx::Class Reaction::Object/;
use Reaction::Class;
use Reaction::Types::Core 'NonEmptySimpleStr';
-use Reaction::Types::DateTime 'DateTime';
+use Reaction::Types::DateTime 'DateTimeObject';
use Reaction::Types::File 'File';
has 'name' => (isa => NonEmptySimpleStr, is => 'rw', required => 1);
has 'foo' => (isa => 'RTest::TestDB::Foo', is => 'rw', required => 1);
-has 'published_at' => (isa => DateTime, is => 'rw');
+has 'published_at' => (isa => DateTimeObject, is => 'rw');
has 'avatar' => (isa => File, is => 'rw');
__PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);