From 14817fd938d8bdc6627e37aca09abb7aba43c290 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 23 Jan 2013 10:28:56 +0100 Subject: [PATCH] DateTime-Helfer: Funktionsnamen in (to|from)_kivitendo umbenannt Mit Legacy-Aliasen. --- SL/Helper/DateTime.pm | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) 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 -- 2.20.1