projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 76181 Invoice date format can set locale from Freeside conf
[freeside.git]
/
FS
/
FS
/
cust_main_Mixin.pm
diff --git
a/FS/FS/cust_main_Mixin.pm
b/FS/FS/cust_main_Mixin.pm
index
6a2e905
..
c36b79a
100644
(file)
--- a/
FS/FS/cust_main_Mixin.pm
+++ b/
FS/FS/cust_main_Mixin.pm
@@
-660,13
+660,13
@@
sub time2str_local {
$self->{_date_format} ||= {};
if (!exists($self->{_dh})) {
$self->{_date_format} ||= {};
if (!exists($self->{_dh})) {
- my $
cust_main =
$self->cust_main;
-
my $locale = $cust_main->locale if $cust_main
;
- $locale ||= 'en_US';
+ my $
locale = $self->cust_main->locale if
$self->cust_main;
+
$locale ||= FS::Conf->new->config('locale') || 'en_US'
;
+
my %info = FS::Locales->locale_info($locale);
my %info = FS::Locales->locale_info($locale);
- my $dh = eval { Date::Language->new($info{'name'}) } ||
- Date::Language->new(); # fall back to English
- $self->{_dh} = $dh;
+
+ $self->{_dh} = eval { Date::Language->new($info{'name'}) }
+ || Date::Language->new(); # fall back to English
}
if ($format eq 'short') {
}
if ($format eq 'short') {