added API for handling work contract times (#4016)

This commit is contained in:
Kevin Papst
2023-05-13 01:24:15 +02:00
committed by GitHub
parent 4b2a3669e6
commit 43bd7bf1ab
53 changed files with 2684 additions and 27 deletions

View File

@@ -514,4 +514,17 @@
KimaiReloadPageWidget.create('{{ events }}', {% if full_reload is same as true %}true{% else %}false{% endif %});
});
</script>
{% endmacro %}
{% endmacro %}
{% macro work_times_result(should, actual, decimal) %}
{% set result = actual - should %}
{% if result == 0 %}
<span class="work_time_exact">{{ result|duration(decimal) }}</span>
{% elseif should == 0 and actual > 0 %}
<span class="work_time_positive text-green">+{{ actual|duration(decimal) }}</span>
{% elseif result < 0 %}
<span class="work_time_negative text-red">{{ result|duration(decimal) }}</span>
{% else %}
<span class="work_time_positive text-green">+{{ result|duration(decimal) }}</span>
{% endif %}
{% endmacro %}