View | Details | Raw Unified | Return to bug 41974
Collapse All | Expand All

(-)a/C4/Context.pm (-6 / +1 lines)
Lines 778-789 sub get_versions { Link Here
778
=cut
778
=cut
779
779
780
sub tz {
780
sub tz {
781
    my $self = shift;
781
    return Koha::Config->get_instance->timezone_dt;
782
    if ( !defined $context->{tz} ) {
783
        my $timezone = $context->{config}->timezone;
784
        $context->{tz} = DateTime::TimeZone->new( name => $timezone );
785
    }
786
    return $context->{tz};
787
}
782
}
788
783
789
=head2 IsSuperLibrarian
784
=head2 IsSuperLibrarian
(-)a/Koha/Config.pm (-1 / +12 lines)
Lines 68-74 file will be read only the first time. Link Here
68
68
69
=cut
69
=cut
70
70
71
our %configs;
71
our %configs = ();
72
73
our $timezone_dt = undef;
72
74
73
sub get_instance {
75
sub get_instance {
74
    my ( $class, $file ) = @_;
76
    my ( $class, $file ) = @_;
Lines 214-219 sub timezone { Link Here
214
    return $timezone;
216
    return $timezone;
215
}
217
}
216
218
219
sub timezone_dt {
220
    my ($self) = @_;
221
222
    unless ( defined $timezone_dt ) {
223
        $timezone_dt = DateTime::TimeZone->new( name => $self->timezone );
224
    }
225
    return $timezone_dt;
226
}
227
217
sub _read_from_dom_node {
228
sub _read_from_dom_node {
218
    my ( $class, $node, $config ) = @_;
229
    my ( $class, $node, $config ) = @_;
219
230
(-)a/Koha/Object.pm (-2 / +2 lines)
Lines 28-33 use List::MoreUtils qw( any ); Link Here
28
use DateTime::Format::MySQL;
28
use DateTime::Format::MySQL;
29
29
30
use Koha::Database;
30
use Koha::Database;
31
use Koha::Config;
31
use Koha::DateTime::Format::RFC3339;
32
use Koha::DateTime::Format::RFC3339;
32
use Koha::DateTime::Format::SQL;
33
use Koha::DateTime::Format::SQL;
33
use Koha::Exceptions::Object;
34
use Koha::Exceptions::Object;
Lines 880-886 sub _recursive_fixup { Link Here
880
                        $value = $dtf->format_date($dt);
881
                        $value = $dtf->format_date($dt);
881
                    } else {
882
                    } else {
882
                        my $dt = Koha::DateTime::Format::RFC3339->parse_datetime($value);
883
                        my $dt = Koha::DateTime::Format::RFC3339->parse_datetime($value);
883
                        $dt->set_time_zone( C4::Context->tz );
884
                        $dt->set_time_zone( Koha::Config->get_instance->timezone_dt );
884
                        $value = $dtf->format_datetime($dt);
885
                        $value = $dtf->format_datetime($dt);
885
                    }
886
                    }
886
                } catch {
887
                } catch {
887
- 

Return to bug 41974