X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/008c2e1529744e195616ac2cbf7736f06a90816e..cd73950c9f7616255cf917e36a6e1a03627f860d:/SL/Locale.pm diff --git a/SL/Locale.pm b/SL/Locale.pm index ccf494343..3216cd270 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -403,8 +403,7 @@ sub format_date_object { my ($self, $datetime, %params) = @_; my $format = $::myconfig{dateformat} || 'yyyy-mm-dd'; - $format =~ s/yyyy/\%Y/; - $format =~ s/yy/\%y/; + $format =~ s/yy(?:yy)?/\%Y/; $format =~ s/mm/\%m/; $format =~ s/dd/\%d/; @@ -540,7 +539,20 @@ sub get_local_time_zone { return $self->{local_time_zone}; } +sub language_join { + my ($self, $items, %params) = @_; + + $items ||= []; + $params{conjunction} ||= $::locale->text('and'); + my $num = scalar @{ $items }; + + return 0 == $num ? '' + : 1 == $num ? $items->[0] + : join(', ', @{ $items }[0..$num - 2]) . ' ' . $params{conjunction} . ' ' . $items->[$num - 1]; +} + 1; + __END__ =pod