X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/642d15dd0286fccba9e86f1e97b0781e1f5b2869..76da5bf5bf6929e4cc11a8eb48a53e078ff6e167:/SL/Locale.pm diff --git a/SL/Locale.pm b/SL/Locale.pm index e9967396c..3f7df7e82 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -55,7 +55,7 @@ sub new { my ($type, $country) = @_; - $country ||= $::language; + $country ||= $::lx_office_conf{system}->{language}; $country =~ s|.*/||; $country =~ s|\.||g; @@ -96,8 +96,8 @@ sub _init { } } - my $db_charset = $main::dbcharset || Common::DEFAULT_CHARSET; - $self->{is_utf8} = (any { lc($::dbcharset || '') eq $_ } qw(utf8 utf-8 unicode)) ? 1 : 0; + my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET; + $self->{is_utf8} = (any { lc($::lx_office_conf{system}->{dbcharset} || '') eq $_ } qw(utf8 utf-8 unicode)) ? 1 : 0; if ($self->{is_utf8}) { binmode STDOUT, ":utf8"; @@ -497,4 +497,10 @@ sub restore_numberformat { $myconfig->{numberformat} = $self->{saved_numberformat} if $self->{saved_numberformat}; } +sub get_local_time_zone { + my $self = shift; + $self->{local_time_zone} ||= DateTime::TimeZone->new(name => 'local'); + return $self->{local_time_zone}; +} + 1;