From: Moritz Bunkus Date: Wed, 23 Jan 2013 09:28:56 +0000 (+0100) Subject: DateTime-Helfer: Funktionsnamen in (to|from)_kivitendo umbenannt X-Git-Tag: release-3.1.0beta1~673 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=14817fd938d8bdc6627e37aca09abb7aba43c290;p=kivitendo-erp.git DateTime-Helfer: Funktionsnamen in (to|from)_kivitendo umbenannt Mit Legacy-Aliasen. --- diff --git a/SL/Helper/DateTime.pm b/SL/Helper/DateTime.pm index 749bd0764..1d0b38acc 100644 --- a/SL/Helper/DateTime.pm +++ b/SL/Helper/DateTime.pm @@ -10,16 +10,26 @@ sub today_local { return shift->now(time_zone => $::locale->get_local_time_zone)->truncate(to => 'day'); } -sub to_lxoffice { +sub to_kivitendo { my $self = shift; my %params = (scalar(@_) == 1) && (ref($_[0]) eq 'HASH') ? %{ $_[0] } : @_; return $::locale->format_date_object($self, %params); } -sub from_lxoffice { +sub to_lxoffice { + # Legacy name. + goto &to_kivitendo; +} + +sub from_kivitendo { return $::locale->parse_date_to_object(\%::myconfig, $_[1]); } +sub from_lxoffice { + # Legacy name. + gofrom &from_kivitendo; +} + 1; __END__ @@ -42,18 +52,22 @@ Returns the current time with the time zone set to the local time zone. Returns the current date with the time zone set to the local time zone. -=item C +=item C Formats the date and time according to the current kivitendo user's date format with L. -=item C +The legacy name C is still supported. + +=item C Parses a date string formatted in the current kivitendo user's date format and returns an instance of L. Note that only dates can be parsed at the moment, not the time -component (as opposed to L). +component (as opposed to L). + +The legacy name C is still supported. =back