getting DateTime formatter from schema storage.
Error can occur earlier in code, unrelated to datetime formatter, and cause formatter to not be set. Don’t bail due to ancient errors.
Signed-off-by: Charlie Garrison <cngarrison@gmail.com>
# mess with dates if specified
if ($set->{datetime_relative}) {
- my $formatter= $object->result_source->schema->storage->datetime_parser;
- unless ($@ || !$formatter) {
+ my $formatter= eval {$object->result_source->schema->storage->datetime_parser};
+ unless (!$formatter) {
my $dt;
if ($set->{datetime_relative} eq 'today') {
$dt = DateTime->today;