show only published events at calendar view

This commit is contained in:
Milan
2018-12-26 21:36:25 +01:00
parent 9152289728
commit c38a1c33c0
2 changed files with 4 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ use Date::Calc();
use template();
use cache();
use events();
use base 'Exporter';
our @EXPORT_OK = qw(init get_cached_or_render get render get_calendar_weeks configure_cache);
@@ -203,7 +204,7 @@ sub get {
my $woy_year = undef;
for my $date (@$week) {
my ( $year, $month, $day ) = split( /\-/, $date );
my ( $year, $month, $day ) = split( /\-/, $date, 3 );
my $weekday = 0;
my $day_result = undef;

View File

@@ -1414,6 +1414,7 @@ sub get_by_date_range {
$end = time::add_hours_to_datetime( $end, $day_starting_hour );
my $conditions = [];
push @$conditions, 'published = 1';
push @$conditions, 'start between ? and ?';
my $bind_values = [ $start, $end ];
@@ -1430,7 +1431,7 @@ sub get_by_date_range {
where $conditions
};
#print STDERR Dumper($query);
#print STDERR Dumper($query) . Dumper($bind_values);
my $events = db::get( $dbh, $query, $bind_values );