X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/ee04154abdc7b72e773636d09ac3fbad5bf0a014..e214accccd89a9c8:/SL/Helper/DateTime.pm diff --git a/SL/Helper/DateTime.pm b/SL/Helper/DateTime.pm index b72207f8a..3d6c78e10 100644 --- a/SL/Helper/DateTime.pm +++ b/SL/Helper/DateTime.pm @@ -2,6 +2,8 @@ package DateTime; use strict; +use SL::Util qw(_hashify); + sub now_local { return shift->now(time_zone => $::locale->get_local_time_zone); } @@ -10,9 +12,13 @@ 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 = shift; - my %params = (scalar(@_) == 1) && (ref($_[0]) eq 'HASH') ? %{ $_[0] } : @_; + my ($self, %params) = _hashify(1, @_); return $::locale->format_date_object($self, %params); }