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 override accept_events => sub {
30 ('value_string', super());
40 Reaction::UI::ViewPort::Field::DateTime
48 Accessor for the string representation of the DateTime object.
50 =head2 value_string_default_format
52 By default it is set to "%F %H:%M:%S".
58 =head2 L<Reaction::UI::ViewPort::Field>
62 See L<Reaction::Class> for authors.
66 See L<Reaction::Class> for the license.