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

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

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

Highlighted
Helper I
Helper I

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

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!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,154)