cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Selecting Only Particular Days with Date Picker

Hello there, I'm working on a time slot booking app for which I need to provide employees to book only particular days i.e. Tuesday's and Thursday's in Date Picker. I can't figure out how to do it.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Anonymous ,

Do you want the employees to be able to book Tuesday's and Thursday's in DatePicker, and disable other weekdays, right?

 

If you want the employees to be able to book Tuesday's and Thursday's in DatePicker, and disable other weekdays, I afraid that there is no way to achieve your needs using the native DatePicker control in your canvas app.

 

As an alternative solution, you could consider custom a DatePicker control in your app, then you could disable the weekdays within the custom DatePicker based on your needs.

 

I have customized a DatePicker in my app, and disable other weekdays in it except the Tuesday and Thursday. the screenshot as below:

2.JPG

 

3.JPG

Set the DisplayMode property of the Title2 inside the MonthDayGallery1 to following:

If(
    Weekday(DateAdd(_firstDayInView, ThisItem.Value, Days)) = 3 || Weekday(DateAdd(_firstDayInView, ThisItem.Value, Days)) = 5,
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

More details about customizing DatePicker control in PowerApps, please check the following article:

https://docs.microsoft.com/en-us/archive/blogs/davidni/building-an-interactive-calendar-view-with-powerapps

 

I have attached my sample custom DatePicker app below, please consider refer to it. When you want to reference the selected date value from the custom datepicker control, please reference value through the _dateSelected variable directly.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
jcfDaniel
Super User
Super User

Hi, how are the days made available for users? Are they preset or determined bu availability?


Regards. JD.
v-xida-msft
Community Support
Community Support

Hi @Anonymous ,

Do you want the employees to be able to book Tuesday's and Thursday's in DatePicker, and disable other weekdays, right?

 

If you want the employees to be able to book Tuesday's and Thursday's in DatePicker, and disable other weekdays, I afraid that there is no way to achieve your needs using the native DatePicker control in your canvas app.

 

As an alternative solution, you could consider custom a DatePicker control in your app, then you could disable the weekdays within the custom DatePicker based on your needs.

 

I have customized a DatePicker in my app, and disable other weekdays in it except the Tuesday and Thursday. the screenshot as below:

2.JPG

 

3.JPG

Set the DisplayMode property of the Title2 inside the MonthDayGallery1 to following:

If(
    Weekday(DateAdd(_firstDayInView, ThisItem.Value, Days)) = 3 || Weekday(DateAdd(_firstDayInView, ThisItem.Value, Days)) = 5,
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

More details about customizing DatePicker control in PowerApps, please check the following article:

https://docs.microsoft.com/en-us/archive/blogs/davidni/building-an-interactive-calendar-view-with-powerapps

 

I have attached my sample custom DatePicker app below, please consider refer to it. When you want to reference the selected date value from the custom datepicker control, please reference value through the _dateSelected variable directly.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I'm wondering if, using similar logic to disable certain days of the week we could disable days that fall in the past.

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Users online (5,254)