fix months
This commit is contained in:
@@ -6,14 +6,13 @@ class MonthHelper
|
||||
public function takeMonths() : array
|
||||
{
|
||||
$startDate = new \DateTime("-6 months");
|
||||
|
||||
$startDate->modify("first day of this month");
|
||||
$return = [];
|
||||
for ($i=1; $i<=11; $i++) {
|
||||
$tmp = clone $startDate;
|
||||
$tmp->modify("+$i month");
|
||||
$return[$i] = $tmp;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,5 +19,22 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{# <ul class="nav nav-tabs">#}
|
||||
{# <li class="nav-item">#}
|
||||
{# <a class="nav-link {% if currentMonth is null %}active{% endif %}" aria-current="page" href="{{ path(routeName, {monthId:-1}) }}">Zaległe</a>#}
|
||||
{# </li>#}
|
||||
{# {% for id,month in months %}#}
|
||||
{# {% set isCurrent = currentMonth is not null and month | date("Y-m") == currentMonth | date("Y-m") %}#}
|
||||
{# <li class="nav-item">#}
|
||||
{# <a class="nav-link {% if isCurrent %}active{% endif %}" href="{{ path(routeName,{monthId: id}) }}" aria-current="page">#}
|
||||
{# {% if routeName=='app_schedule' %}#}
|
||||
{# {{ id }}#}
|
||||
{# {% else %}#}
|
||||
{# {{ month | date("Y-m") }}#}
|
||||
{# {% endif %}#}
|
||||
{# </a>#}
|
||||
{# </li>#}
|
||||
{# {% endfor %}#}
|
||||
{# </ul>#}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user