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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans