Answer the question
In order to leave comments, you need to log in
How to group in nunjucks date by different hour?
I can’t figure out how to group data whose initial value is different
for the example
2017-10-16 12:07:07
2017-10-16 15:09:08
It is necessary to group according to this format on October 16 .
I added a filter to change the date, but it seems to change it after grouping and there is no sense from this.
The result is this
16 Oct
16 Oct
16 Oct
3 Nov
29 Nov
29 Nov
<div class="container">
<div class="row">
<div class="col-5">
{% for date , block in block | groupby("date") %}
<div class="date">{{date |date }}</div>
{% endfor %}
</div>
</div>
</div>
{
"date": "2017-10-16 15:09:08",
"id": "564564867363231401",
"image": "img",
"name": "расчет",
"name:1": "staaf1",
"price": "102.0",
"quantity": "72",
"removed": "0"
},
{
"date": "2017-10-16 15:09:08",
"id": "564563124867361410",
"image": "img",
"name": "расчет",
"name:1": "staff",
"price": "121.0",
"quantity": "41",
"removed": "0"
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question