diff --git a/core/templates/timeline/_timeline.html b/core/templates/timeline/_timeline.html index c2cc5b95..3a5aff5e 100644 --- a/core/templates/timeline/_timeline.html +++ b/core/templates/timeline/_timeline.html @@ -17,52 +17,48 @@ {% if timeline_objects %}

@@ -82,4 +78,4 @@

{% else %}
{% trans "No events" %}
-{% endif %} +{% endif %} \ No newline at end of file diff --git a/core/timeline.py b/core/timeline.py index 1d467b3a..372f1564 100644 --- a/core/timeline.py +++ b/core/timeline.py @@ -24,7 +24,11 @@ def get_objects(date, child=None): _add_tummy_times(min_date, max_date, events, child) _add_notes(min_date, max_date, events, child) - events.sort(key=lambda x: x['time'], reverse=True) + explicit_type_ordering = {'start': 0, 'end': 1} + events.sort( + key=lambda x: (x['time'], explicit_type_ordering.get(x.get('type'), -1)), + reverse=True, + ) return events