this is the layout file:
{% extends 'partials/base.html.twig' %}
{% block content %}
{% import "partials/macros/movie_macros.html.twig" as movie_macros %}
{% set all_movies = page.find('/movies').collection %}
{{ movie_macros.return_current_movies(all_movies) }}
{% endblock %}
and this is the macro!
{% macro return_current_movies(all_movies) %}
{% set current_year = now|date("Y") %}
{% set current_month = now|date("n") %}
{% set current_day = now|date("j") %}
<div class="movies">
{% for each_movie in all_movies %}
{% if each_movie.header.active == true %}
{% for each_show in each_movie.header.shows %}
{% set show_year = each_show.date|date("Y") %}
{% set show_month = each_show.date|date("n") %}
{% set show_day = each_show.date|date("j") %}
{% endfor %}
{% endif %}
{% endfor %}
</div>
{% endmacro %}
I’d like to return a collection of movies that are currently running (this day, last week, this week and next week) … thanks!