]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/Helpers/AttrDate.pm
Attribute Helper umgeschrieben.
[mfinanz.git] / SL / DB / Helpers / AttrDate.pm
diff --git a/SL/DB/Helpers/AttrDate.pm b/SL/DB/Helpers/AttrDate.pm
deleted file mode 100644 (file)
index 38d5696..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package SL::DB::Helpers::AttrDate;
-
-use strict;
-
-use Carp;
-use English;
-
-sub define {
-  my $package     = shift;
-  my $attribute   = shift;
-  my %params      = @_;
-
-  no strict 'refs';
-  *{ $package . '::' . $attribute . '_as_date' } = sub {
-    my ($self, $string) = @_;
-
-    if (@_ > 1) {
-      if ($string) {
-        my ($yy, $mm, $dd) = $::locale->parse_date(\%::myconfig, $string);
-        $self->$attribute(DateTime->new(year => $yy, month => $mm, day => $dd));
-      } else {
-        $self->$attribute(undef);
-      }
-    }
-
-    return $self->$attribute
-      ? $::locale->reformat_date(
-          { dateformat => 'yy-mm-dd' },
-          $self->${attribute}->ymd,
-          $::myconfig{dateformat}
-        )
-      : undef;
-  };
-
-  return 1;
-}
-
-1;