cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TCH
Level: Powered On

DatePicker

Hi there, 

I'm building something where i need to link some input data to a date. I've been playing around with the Datepicker. The Datepicker defaults to todays date. 


DatePick.PNG

However, what i would like is for it to display the date of a specific weekdat, eg. Monday. 

Is there away to make the datepicker display a specific weekday, so lets say I had one that displayed todays date, and then one that displayed only the date of for example Monday Smiley Happy 

Cheers. 
- Toby

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: DatePicker

Hi @TCH ,

Do you want to display a Weekday number (e.g. Monday) within the DatePicker control rather than a actual date value (e.g. 09/20/2019)?

 

If you want to display a Weekday number (e.g. Monday) within the DatePicker control rather than a actual date value (e.g. 09/20/2019), I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, please take a try with the following workaround:

Please consider add a Label within your app, set the Text property to following:

If(
   Weekday(DatePicker1.SelectedDate) = 1,
   "Sunday", 
   Weekday(DatePicker1.SelectedDate) = 2,
   "Monday",
   Weekday(DatePicker1.SelectedDate) = 3,
   "Tuesday",
   Weekday(DatePicker1.SelectedDate) = 4,
   "Wednesday",
   Weekday(DatePicker1.SelectedDate) = 5,
   "Thursday",
   Weekday(DatePicker1.SelectedDate) = 6,
   "Friday",
   Weekday(DatePicker1.SelectedDate) = 7,
   "Saturday"
)

then put the Label control over the DatePicker box (make the Label control override the DatePicker box), set the Fill property of this Label to following:

RGBA(141, 198, 63, 1)

set the Color property of this Label to following:

RGBA(255, 255, 255, 1)

then click "Home"-> "Reorder"-> "Bring to front" option to make the Label display in front of the DatePicker box.

 

Please check the following GIF screenshot for more details:

  Test.gif

 

In addition, you could also consider create a custom interactive Calendar view within your app to achieve your needs:

https://blogs.msdn.microsoft.com/davidni/2016/12/13/building-an-interactive-calendar-view-with-power...

 

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

Super User
Super User

Re: DatePicker

Hey @TCH 

 

I published this custom re-usable date picker control that allows you to restrict selection of date ranges too. Check this out here: https://powerusers.microsoft.com/t5/Components-Samples/Custom-Calendar-to-Restrict-range-to-Date-Sel...

 

Feel free to download and use it. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

6 REPLIES 6
Super User
Super User

Re: DatePicker

Hey @TCH 

 

If you wish to default to monday's date, you can use the expression on "DefaultDate" property as:
 
Today() - Weekday(Today(), MondayZero)
 
If you are looking for restricting the dates/days in a datepicker, this is currently not doable. You can only restrict Years as of now. If you think, this should be added as a functionality, please raise an idea on: https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
TCH
Level: Powered On

Re: DatePicker

Hi @yashag2255 

Thanks very much for the answer, a shame that is not yet doable, but I will definately raise that as an idea as I think this would be a valuable thing to add, as right now it seems rather hard to link up input data to a specific date, or even make a condition based on a specific date Smiley Happy 

- But thanks very much for the answer Smiley Happy 

Super User
Super User

Re: DatePicker

Hey @TCH 

 

You can walk an extra mile and try exploring to create a custom component for that. Let me try that and if successful, I will post it in the components gallery and let you know. 

 

If your issue is resolved, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

TCH
Level: Powered On

Re: DatePicker

@yashag2255 that sounds fantastic, and would of course be very helpful. 

I too will look into ways of possible making a custom solution to this Robot Happy

- Toby

Community Support Team
Community Support Team

Re: DatePicker

Hi @TCH ,

Do you want to display a Weekday number (e.g. Monday) within the DatePicker control rather than a actual date value (e.g. 09/20/2019)?

 

If you want to display a Weekday number (e.g. Monday) within the DatePicker control rather than a actual date value (e.g. 09/20/2019), I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, please take a try with the following workaround:

Please consider add a Label within your app, set the Text property to following:

If(
   Weekday(DatePicker1.SelectedDate) = 1,
   "Sunday", 
   Weekday(DatePicker1.SelectedDate) = 2,
   "Monday",
   Weekday(DatePicker1.SelectedDate) = 3,
   "Tuesday",
   Weekday(DatePicker1.SelectedDate) = 4,
   "Wednesday",
   Weekday(DatePicker1.SelectedDate) = 5,
   "Thursday",
   Weekday(DatePicker1.SelectedDate) = 6,
   "Friday",
   Weekday(DatePicker1.SelectedDate) = 7,
   "Saturday"
)

then put the Label control over the DatePicker box (make the Label control override the DatePicker box), set the Fill property of this Label to following:

RGBA(141, 198, 63, 1)

set the Color property of this Label to following:

RGBA(255, 255, 255, 1)

then click "Home"-> "Reorder"-> "Bring to front" option to make the Label display in front of the DatePicker box.

 

Please check the following GIF screenshot for more details:

  Test.gif

 

In addition, you could also consider create a custom interactive Calendar view within your app to achieve your needs:

https://blogs.msdn.microsoft.com/davidni/2016/12/13/building-an-interactive-calendar-view-with-power...

 

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

Super User
Super User

Re: DatePicker

Hey @TCH 

 

I published this custom re-usable date picker control that allows you to restrict selection of date ranges too. Check this out here: https://powerusers.microsoft.com/t5/Components-Samples/Custom-Calendar-to-Restrict-range-to-Date-Sel...

 

Feel free to download and use it. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 77 members 3,655 guests
Please welcome our newest community members: