
Hi,
I have developed a web template using liquid scripting. I have a scnario where i need to compare 2 dates for example if Date1Value is greater Date2Value. There are few more comparisons like this.
I was to find date related article (https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-filters#date_add_days) on the Microsoft Documents. Unfortunately, that doesn't explain anything about how to compare 2 dates. I found another article (http://himbap.com/blog/?p=3347) this explains bit complex way to compare dates.
Is there any easy way to achieve this comparison in Microsoft D365 Portal? like in JQuery or C#?
Thanks
this simple code seems to work for me, you can achieve that via jQuery as well if you need
{% assign today = now %}
{% assign yesterday = now | date_add_days: -1 %}
<p>Today: {{ today }}</p>
<p>Yesterday: {{ yesterday }}</p>
<p>{% if today > yesterday %}Today is bigger than yesterday{% else %}Today is lower than yesterday{% endif %}</p>