cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ewoud
Helper III
Helper III

Datepicker only last day of the month

Hi there,

 

Is it possible to restrict a date picker to only be able to pick the last day of every month?

1 ACCEPTED SOLUTION

Accepted Solutions
Ewoud
Helper III
Helper III

I have been able (with a little help) to solve it with a collection. In the collection in the OnStart Property the collection shows every month with the last day of each month. Then on the Update property of the date field I added a formula that looks at the collection and then resets the date picked to the last day of that month.

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Ewoud ,

There is no property on a date picker that changes the days displayed, but you could hard-code the OnChange event to only accept the last of each month (if it is not, reset the control).

 

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.

Digital
Super User
Super User

Unfortunately there is no easy way to restrict dates in the date picker. There are idea threads about this.

 

There are a number of date picker components you can install that are more flexible in terms of selecting dates ranges and restricting dates.

Ewoud
Helper III
Helper III

I have been able (with a little help) to solve it with a collection. In the collection in the OnStart Property the collection shows every month with the last day of each month. Then on the Update property of the date field I added a formula that looks at the collection and then resets the date picked to the last day of that month.

UdayAdhikari
Continued Contributor
Continued Contributor

@Ewoud - I know this is an old post but responding so others can benefit.

 

If you pass zero in Day parameter of Date function, it will return last day of previous month. See below examples. This is not documented but have alerted Microsoft team. Read more here: Power Apps: Get last date of the month (undocumented) and more (linkedin.com)

Snag_32b7b13.png

 

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.

Thanks

 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,388)