fix: Specify UTC for TruncDate (#5996)
This commit is contained in:
parent
9ca3d80baa
commit
ba356397c0
|
@ -40,7 +40,7 @@ def model_to_timeline_data(model, field='time', **kwargs):
|
||||||
assert field in [ f.name for f in model._meta.get_fields() ]
|
assert field in [ f.name for f in model._meta.get_fields() ]
|
||||||
|
|
||||||
objects = ( model.objects.filter(**kwargs)
|
objects = ( model.objects.filter(**kwargs)
|
||||||
.annotate(date=TruncDate(field))
|
.annotate(date=TruncDate(field, tzinfo=datetime.timezone.utc))
|
||||||
.order_by('date')
|
.order_by('date')
|
||||||
.values('date')
|
.values('date')
|
||||||
.annotate(count=Count('id')))
|
.annotate(count=Count('id')))
|
||||||
|
|
Loading…
Reference in a new issue