cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahockaday
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
CarlosFigueira
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

3 REPLIES 3
CarlosFigueira
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

thanks a lot. That works perfectly.

How would you set the default date as last day of next month?

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (43,488)