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 / Select the Current wee...
Power Apps
Unanswered

Select the Current week Date in date picker

(0) ShareShare
ReportReport
Posted on by 43

Hi 

I want to pick the date of the current week date form the date picker user to not able to select past week date or else future date.

May I know how to achieve this.

 

Thank you

 

 

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    hey @SathyaKrihnsa 

     

    i use this code to only allow this month or the previous one.

     

    If(And(Month(Today())<>Month(Self.SelectedDate),Month(DateAdd(Today(),-1,TimeUnit.Months))<>Month(Self.SelectedDate)),
     Notify("You can only send comments for this or the previous month.",NotificationType.Error,4000);
     Reset(Self))

     

    maybe you can modify to ur needs

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @SathyaKrihnsa ,

    you can use this code to restrict users from selecting 7 days future or 7 days past:

    If(
     Abs(
     DateDiff(
     Self.SelectedDate,
     Today(),
     TimeUnit.Days
     )
     ) > 7,
     Reset(Self) && Notify("please select correct date")
    )

     

     

     

     


    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.

     

  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at

    Hi @SathyaKrihnsa ,

    I am guessing you are wanting the calendar week - if so, try this on the OnChange of the Date Picker

    If(
     WeekNum(
     Self.SelectedDate,
     StartOfWeek.Monday
     ) <> WeekNum(
     Today(),
     StartOfWeek.Monday
     ),
     Notify(
     "Only this week can be chosen",
     NotificationType.Error
     );
     Reset(Self)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • SathyaKrihnsa Profile Picture
    43 on at

    Hi i want to set Friday date for current week of which where date is selected for the current week 

    how can i achieve this

  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at

    @SathyaKrihnsa ,

    So do you want Monday to Friday of the current week ?

  • SathyaKrihnsa Profile Picture
    43 on at

    For the current week should be Monday to Sunday period which ever date is selected in the current week the date automatically populate should be Friday date of the current week and restrict to not select the any past week or future week .

    Please Help the Solution 

    Thank you

  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at

    @SathyaKrihnsa ,

    The DefaultDate of the Friday of the current week should be

    DateAdd(
     Today(),
     5 - Weekday(
     Today(),
     StartOfWeek.Monday
     )
    )

    This is a separate setting to the OnChange (which I am wondering why you are bothering with as you are setting the DefaultDate, which they can change

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • SathyaKrihnsa Profile Picture
    43 on at

    SathyaKrihnsa_0-1717736326827.png

    Hi for the Current week Monday to Sunday period which ever date is Selected the date should show the current week of Friday date .

    Ex-1 in this picture if the user selects the 9th date  , 3rd ,5th selects it should populate the 7th date(Friday) only and Restrict to not to select  the past week date or future week date .

     

  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at

    @SathyaKrihnsa ,
    As I mentioned putting in the DefaultDate of what I posted will do that without the user selecting anything, so why bother selecting ?

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard