<% $today->day.' '.$mdays{$today->month} %>
% foreach my $event ( @$documents ) { % my $dt = $4.':'.$5 if $event->start =~ /(\d+)-(\d+)-(\d+) (\d+):(\d+)/;
<% $dt %> <% $event->name %> <% $event->abstr %>
% }

<%once> my %mdays = ( 1 => 'января', 2 => 'февраля', 3 => 'марта', 4 => 'апреля', 5 => 'мая', 6 => 'июня', 7 => 'июля', 8 => 'августа', 9 => 'сентября', 10 => 'октября', 11 => 'ноября', 12 => 'декабря', ); <%init> my $prj = $request->{project}; my $profile = $request->{project_profile}; my $root = $request->{project_section}; my $documents; my $today = Contenido::DateTime->new; my $rfw_begin = Contenido::DateTime->new ( postgres => $project->params->{rfw_begin} ); my $rfw_end = Contenido::DateTime->new ( postgres => $project->params->{rfw_end} ); if ( DateTime->compare ($today, $rfw_end) > 0 ) { $today = $rfw_end; } elsif ( DateTime->compare ($today, $rfw_begin) < 0 ) { $today = $rfw_begin; } my ($section) = $keeper->get_sections ( s => $root->id, class => 'promosuite::EventSection', limit => 1, status => 1, ); if ( ref $section ) { $documents = $keeper->get_documents ( s => $section->id, class => 'promosuite::Event', status => 1, start => $today->year.'-'.sprintf("%02d",$today->month).'-'.sprintf("%02d",$today->day), order_by => 'start', return_mode => 'array_ref', ); } return unless @$documents;