Template Update

Hi @THANAS,

To only run a new piece of code starting from a specific date you need to put the old and new piece of code into an if-condition that will look something like this:

{% assign end_date = period.end_date | date: "%Y/%m/%d" %}
{% assign change_date = "2022/01/01" | date: "%Y/%m/%d"   %}

{% if end_date < change_date %}
  OLD CODE
{% else %}
  NEW CODE
{% endif %}

If these are large pieces of code you could also opt to put the old and the new code in a separate part and put the if-condition in the main part of the template code:

{% if end_date < change_date %}
  {% include "parts/old_code" %}
{% else %}
  {% include "parts/new_code" %}
{% endif %}

You can find some more information about using parts here: CASE: use parts to avoid repetitive coding

Kind regards,
Kimberly