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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / check if the date is b...
Power Apps
Unanswered

check if the date is before or after two weeks from the current week

(0) ShareShare
ReportReport
Posted on by

Hi, 

 

I'll be creating a validation wherein I need to check if the date is before or after two weeks from the current week. 

Just wondering if there's available function that I can utilize for this requirement. 

 

Thank you in advance.

Categories:
I have the same question (0)
  • KvB1 Profile Picture
    1,596 on at

    You can just compare the date of a record to Today()+14 using If(

    This does require that the column is a date argument, if its Text you'd have to convert it to a Date first.

    Or is this not what you need?

  • JamesYumnam Profile Picture
    on at

    @Anonymous  in addition to Kvb1's answer which compare your date in your record to Today's date, if you want to actually compare out with respect to the current week. then you can use Weekday function. with this, find out the current week's start and end date first. then if you want to compare before, use the start date of the current week minus (-) 14, and if you want to compare after, use the end date of the week plus (+) 14.

  • Verified answer
    ArchitectMadhan Profile Picture
    1,584 on at

    Hi @Anonymous ,

     

    I have used the formula If((Self.SelectedDate>(Today()-14) && Self.SelectedDate<(Today()+14)),Self.SelectedDate,"Select valid date") to show the warning notification on selection of date in the date picker. You have to use the same formula in both OnSelect and OnChange. Apart from this I have also set the Start Year and End Year in advanced properties of date picker to 2021. So that user can see only the current year calendar.

    ArchitectMadhan_1-1626779867934.png

     

    If you find my solution helpful for resolving the issue, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    on at

    Thanks so much... This helped!!!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard