From: Thomas Heck Date: Mon, 5 Aug 2013 14:35:24 +0000 (+0200) Subject: DateTime::to_kivitendo_time: Formatierung eines DateTimes als Zeit X-Git-Tag: release-3.1.0beta1~66 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=3711d95e5e6f1df8c1950c033f4c3549a7c126fd;p=kivitendo-erp.git DateTime::to_kivitendo_time: Formatierung eines DateTimes als Zeit --- diff --git a/SL/Helper/DateTime.pm b/SL/Helper/DateTime.pm index 639ed4531..3d6c78e10 100644 --- a/SL/Helper/DateTime.pm +++ b/SL/Helper/DateTime.pm @@ -12,6 +12,11 @@ sub today_local { return shift->now(time_zone => $::locale->get_local_time_zone)->truncate(to => 'day'); } +sub to_kivitendo_time { + my ($self, %params) = _hashify(1, @_); + return $::locale->format_date_object_to_time($self, %params); +} + sub to_kivitendo { my ($self, %params) = _hashify(1, @_); return $::locale->format_date_object($self, %params); diff --git a/SL/Locale.pm b/SL/Locale.pm index b6065da77..15b57df38 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -380,6 +380,12 @@ sub parse_date_to_object { return $yy && $mm && $dd ? DateTime->new(year => $yy, month => $mm, day => $dd) : undef; } +sub format_date_object_to_time { + my ($self, $datetime, %params) = @_; + + return $datetime->strftime('%H:%M'); +} + sub format_date_object { my ($self, $datetime, %params) = @_;