diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html index 4237980c58..33afb7ba18 100644 --- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html +++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html @@ -7,7 +7,7 @@
@@ -18,16 +18,23 @@ {% endif %}
-
- {%if build.outcome == build.SUCCEEDED%}{%elif build.outcome == build.FAILED%}{%else%}{%endif%} + +
+ {% if build.completed_on|format_build_date %} + {{ build.completed_on|date:'d/m/y H:i' }} + {% else %} + {{ build.completed_on|date:'H:i' }} + {% endif %} +
{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
{% if build.errors_no %} diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index 99fd4cf287..f564edfe49 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py @@ -268,3 +268,11 @@ def get_dict_value(dictionary, key): return dictionary[key] except (KeyError, IndexError): return '' + +@register.filter +def format_build_date(completed_on): + now = timezone.now() + delta = now - completed_on + + if delta.days >= 1: + return True