cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahockaday
Level: Powered On

Set Default date of Date Picker to first and last day of that Month

I have 2 date pickers on my app that I am using to filter the content. Is there a way to set the default date of the date pickers so the first one defaults to the first day of that days month and the second date picker to default to the last day of the month based on today. Currently I am setting the first date pickers default date to Today()-21 and the second to Today()+7, so it shows me kind of a rolling 30 days but not really a month view where it is for the particular month where since today is June 12, it is setting the default date in date picker one to June 1 and the default date in date picker 2 to June 30.  

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Set Default date of Date Picker to first and last day of that Month

You can set the first date picker DefaultDate property to:

Date(Year(Today()), Month(Today()), 1)

And the second one to:

Date(Year(Today()), Month(Today()) + 1, 0)

or

DateAdd(
    DateAdd(
        Date(Year(Today()), Month(Today()), 1),
        1,
        Months),
    -1,
    Days)

View solution in original post

2 REPLIES 2
Highlighted
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Set Default date of Date Picker to first and last day of that Month

You can set the first date picker DefaultDate property to:

Date(Year(Today()), Month(Today()), 1)

And the second one to:

Date(Year(Today()), Month(Today()) + 1, 0)

or

DateAdd(
    DateAdd(
        Date(Year(Today()), Month(Today()), 1),
        1,
        Months),
    -1,
    Days)

View solution in original post

ahockaday
Level: Powered On

Re: Set Default date of Date Picker to first and last day of that Month

thanks a lot. That works perfectly.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 186 members 4,991 guests
Please welcome our newest community members: