1 package Reaction::UI::ViewPort::Field::Mutable::DateTime;
7 class 'Reaction::UI::ViewPort::Field::Mutable::DateTime', is 'Reaction::UI::ViewPort::Field::DateTime', which {
9 does 'Reaction::UI::ViewPort::Field::Role::Mutable';
12 ( is => 'rw', isa => 'Str', lazy_build => 1, trigger_adopt('value_string') );
14 implements adopt_value_string => as {
16 my $value = $self->value_string;
17 my ($epoch) = Time::ParseDate::parsedate($value);
19 my $dt = 'DateTime'->from_epoch( epoch => $epoch );
22 $self->message("Could not parse date or time");
28 around accept_events => sub { ('value_string', shift->(@_)) };
37 Reaction::UI::ViewPort::Field::DateTime
45 Accessor for the string representation of the DateTime object.
47 =head2 value_string_default_format
49 By default it is set to "%F %H:%M:%S".
55 =head2 L<Reaction::UI::ViewPort::Field>
59 See L<Reaction::Class> for authors.
63 See L<Reaction::Class> for the license.