The goal is to show a word when date field qualifies for tomorrow or today instead of numeric date.
Setting and calling variables:
{% set deliveryDate = order.deliveryDate %}
{% set tomorrow = now|date_modify("+ 1 day") %}
{% if deliveryDate == tomorrow %}
{% set deliveryDate = "tomorrow" %}
{% elseif deliveryDate == now %}
{% set deliveryDate = "today" %}
{% else %}
{% set deliveryDate = deliveryDate|date("d.m.Y") %}
{% endif %}
My date field has selected value of tomorrow whereas the first statement should be truthy.
So I think I'm comparing two objects with the same values but different classes? I had figured it out by formatting the date objects to strings using day() filter.
But why is THAT happening on the first place?