Modify the display of one field by the value of another field
Add a boolean field as a condition to hide the end-date is a fine solution. For hiding the field you can either check for the boolean in the template:

{% if $node-&gt;field_hide_end_date-&gt;value %}
    {{ $node-&gt;field_range-&gt;value|format_date('my_custom_date_format') }}
{% else %}
    {# Original version of the field #}
    {{ $content['field_range'] }}
{% endif %}


Or change the value in a preprocess method

function custom_module_preprocess_node(&amp;$variables) {
  if (array_key_exists('field_period', $variables['elements'])) {
    $node = $variables['elements']['#node'];

    if ($node-&gt;field_hide_end_date-&gt;value) {
      $variables['elements']['field_period'] = [
        '#markup' =&gt; (new DrupalDateTime($node-&gt;field_period-&gt;value))-&gt;format('d-m-Y'),
      ];
    }
    // else: business as usual.
  }
}