cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Power Apps
Power Apps

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
Power Apps
Power Apps

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

Highlighted

thanks a lot. That works perfectly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (6,721)