1 package Reaction::UI::ViewPort::Field::Mutable::DateTime;
7 class 'Reaction::UI::ViewPort::Field::Mutable::DateTime',
8 is 'Reaction::UI::ViewPort::Field::DateTime', which {
10 does 'Reaction::UI::ViewPort::Field::Role::Mutable';
13 ( is => 'rw', isa => 'Str', lazy_build => 1, trigger_adopt('value_string') );
15 implements adopt_value_string => as {
17 my $value = $self->value_string;
18 my ($epoch) = Time::ParseDate::parsedate($value);
20 my $dt = 'DateTime'->from_epoch( epoch => $epoch );
23 $self->message("Could not parse date or time");
29 around accept_events => sub { ('value_string', shift->(@_)) };
38 Reaction::UI::ViewPort::Field::DateTime
46 Accessor for the string representation of the DateTime object.
48 =head2 value_string_default_format
50 By default it is set to "%F %H:%M:%S".
56 =head2 L<Reaction::UI::ViewPort::Field>
60 See L<Reaction::Class> for authors.
64 See L<Reaction::Class> for the license.