Relative

By setting the relative parameter to true, the component will display the date in a relative format. For example, if the date is today, it will show "today". If the date is yesterday, it will show "yesterday". If the date is in the future, it will show "in X days". This provides a more human-friendly way to display dates relative to the current time.

{%- call ui.util.call(show_example) -%} {%- raw %} {%- set now = ui.util.now() -%} {%- set date = now.year ~ "-01-01" -%} {{ ui.datetime(date, relative=true) }} {%- endraw %} {%- endcall %}