package Reaction::Types::DateTime;
use MooseX::Types
- -declare => [qw/DateTimeObject SpanSet TimeRangeCollection/];
+ -declare => [qw/DateTime SpanSet TimeRangeCollection/];
use MooseX::Types::Moose qw/Object ArrayRef/;
use DateTime;
-subtype DateTimeObject,
+subtype DateTime,
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_DateTimeObject => as {
+ implements _build_fields_for_type_Reaction_Types_DateTime_DateTime => 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_DateTimeObject => sub {
+ around _build_fields_for_type_Reaction_Types_DateTime_DateTime => sub {
$_[0]->(@_[1,2], { layout => 'value/date_time', %{ $_[3] || {} } })
};
use Scalar::Util 'blessed';
use Reaction::Class;
-use Reaction::Types::DateTime 'DateTimeObject';
+use Reaction::Types::DateTime;
use aliased 'Reaction::UI::ViewPort::Field';
class DateTime is Field, which {
- has '+value' => (isa => DateTimeObject);
+ has '+value' => (isa => DateTime);
has value_string_default_format => (
isa => 'Str', is => 'rw', required => 1, default => sub { "%F %H:%M:%S" }
implements adopt_value_string => as {
my ($self) = @_;
+warn "WAHEY ".$self->value_string." ".$self;
$self->value($self->value_string);
};
$self->_build_simple_field(attribute => $attr, class => String, %$args);
};
- implements _build_fields_for_type_Reaction_Types_DateTime_DateTimeObject => as {
+ implements _build_fields_for_type_Reaction_Types_DateTime_DateTime => as {
my ($self, $attr, $args) = @_;
$self->_build_simple_field(attribute => $attr, class => DateTime, %$args);
};
};
implements fragment is_checked {
+ warn "WAH: ".$_{viewport}->value_string."; ".$_{viewport}->value." WAAAH ".$_{viewport};
if ($_{viewport}->value) {
render 'is_checked_yes';
} else {
use base qw/DBIx::Class Reaction::Object/;
use Reaction::Class;
use Reaction::Types::Core 'NonEmptySimpleStr';
-use Reaction::Types::DateTime 'DateTimeObject';
+use Reaction::Types::DateTime 'DateTime';
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 => DateTimeObject, is => 'rw');
+has 'published_at' => (isa => DateTime, is => 'rw');
has 'avatar' => (isa => File, is => 'rw');
__PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);