web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Compare Dates in Liquid Web Template (Liquid Script) in Powerapps/Microsoft 365 Portals

(0) ShareShare
ReportReport
Posted on by 155

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

I have the same question (0)
  • Suggested answer
    oliver.rodrigues Profile Picture
    4,052 on at

    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>

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 192 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans