cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ecrevisse
Helper II
Helper II

Multiple date Calendar

Hi Everyone,  i am searching solution with this: how to select multiple: for example 3 days in week ( Monday, Friday and Sunday) and Patch my Data Source ? 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @ecrevisse :

Do you want to get something like this?

003.gif

If so,please try:

1\Add a dropdown control(SelectYear) and set it's 

Items

Sequence(50,1990)

OnChange

Select(Self)

OnSelect

	Set(_firstDayOfMonth,Date(SelectYear.Selected.Value,SelectMonth.Selected.Value,1));         
	Set(_firstDayInView, DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth) - 2 + 1), Days));

2\Add a dropdown control(SelectMonth) and set it's 

Items

Sequence(12,1)

OnChange

Select(SelectYear)

OnSelect

Select(SelectYear)

3\Create a Blank vertical Gallery(Gallery6) and set it's 

Items

["Sun","Mon","Tue","Wed","Tus","Fir","Sat"]

WrapCount

7

4\Add a label control into Gallery6

Text

ThisItem.Value

 5\Create a Blank vertical Gallery(Gallery3) and set it's 

Items

[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]

WrapCount

 

7

 

6\Add a label control into Gallery 3

Text

Day(DateAdd(_firstDayInView,ThisItem.Value,Days))

Fill

If(Abs(Self.Text-ThisItem.Value)>10,RGBA(200,200,200,0.3),RGBA(0,0,0,0))

OnSelect

If(DateAdd(_firstDayInView, ThisItem.Value, Days) in CollectedDate,Remove(CollectedDate,{Value:DateAdd(_firstDayInView, ThisItem.Value, Days)}),Collect(CollectedDate, DateAdd(_firstDayInView, ThisItem.Value, Days)))

 7\Add a icon into Gallery3

Visible

DateAdd(_firstDayInView, ThisItem.Value, Days) in CollectedDate

8\Add a button and set it's OnSelect property to:

 

ForAll(
CollectedDate,
Patch(
TargetDataSource,
Defaults(TargetDataSource),
{
Title: "Title",
TheDate: Value
}
)
)

 

Best Regards,

Bof

View solution in original post

Hi, Bof.

 

This one helped me a lot. Thank you!

 

One question though. I wanted to avoid making duplicate dates whenever I patch it to SharePoint. Is there any way to do that? I have been trying the LookUp() function but I can't get the "TheDate: Value" to match with the Date column in SharePoint because it's a record while the latter is date.

 

I would love to hear your response regarding my problem/question.

 

Regards,

Pete

View solution in original post

9 REPLIES 9
v-bofeng-msft
Community Support
Community Support

Hi @ecrevisse :

Do you want to get something like this?

003.gif

If so,please try:

1\Add a dropdown control(SelectYear) and set it's 

Items

Sequence(50,1990)

OnChange

Select(Self)

OnSelect

	Set(_firstDayOfMonth,Date(SelectYear.Selected.Value,SelectMonth.Selected.Value,1));         
	Set(_firstDayInView, DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth) - 2 + 1), Days));

2\Add a dropdown control(SelectMonth) and set it's 

Items

Sequence(12,1)

OnChange

Select(SelectYear)

OnSelect

Select(SelectYear)

3\Create a Blank vertical Gallery(Gallery6) and set it's 

Items

["Sun","Mon","Tue","Wed","Tus","Fir","Sat"]

WrapCount

7

4\Add a label control into Gallery6

Text

ThisItem.Value

 5\Create a Blank vertical Gallery(Gallery3) and set it's 

Items

[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]

WrapCount

 

7

 

6\Add a label control into Gallery 3

Text

Day(DateAdd(_firstDayInView,ThisItem.Value,Days))

Fill

If(Abs(Self.Text-ThisItem.Value)>10,RGBA(200,200,200,0.3),RGBA(0,0,0,0))

OnSelect

If(DateAdd(_firstDayInView, ThisItem.Value, Days) in CollectedDate,Remove(CollectedDate,{Value:DateAdd(_firstDayInView, ThisItem.Value, Days)}),Collect(CollectedDate, DateAdd(_firstDayInView, ThisItem.Value, Days)))

 7\Add a icon into Gallery3

Visible

DateAdd(_firstDayInView, ThisItem.Value, Days) in CollectedDate

8\Add a button and set it's OnSelect property to:

 

ForAll(
CollectedDate,
Patch(
TargetDataSource,
Defaults(TargetDataSource),
{
Title: "Title",
TheDate: Value
}
)
)

 

Best Regards,

Bof

View solution in original post

ecrevisse
Helper II
Helper II

Thank you 🙂 I will try. How add hours reservation to my data ? 

Hi @ecrevisse :

It depends on your specific needs. I suggest you create a new thread and describe your situation and needs in detail.

Best Regards,

Bof

Hi @v-bofeng-msft  everything it is great ! 🙂 Thank's. I have little q for you 🙂  How clear selection when for new user after Navigate function another screen ? Another user logging in app. Can i use Reset function ? 

Hi @ecrevisse :

The date selected by the user is stored in a collection named "CollectedDate".

  • If the current user navigates to another screen and then returns, the selection will not be reset
  • If the current user closes the app and reopens it, the selection will be reset
  • When other users open this app on other devices, the selection will be reset

Best Regards,

Bof

@v-bofeng-msft  thanks ! 🙂 I understand.  Another q for you 🙂 I think it is last. 

How to make the user make a reservation only 1 week in advance. Other days are off, but they are shifting in time.

For example: Today I can book June 14-18. Can I book June 18 for June 21 - 25? Etc. It's Easy Peasy for you 😛 

Hi @v-bofeng-msft what do you think, it is possible  ? i will be grateful for you response 🙂 

 

Best regards, 

Damian

ecrevisse
Helper II
Helper II

@v-bofeng-msft  Little hint 😉🙂 

Hi, Bof.

 

This one helped me a lot. Thank you!

 

One question though. I wanted to avoid making duplicate dates whenever I patch it to SharePoint. Is there any way to do that? I have been trying the LookUp() function but I can't get the "TheDate: Value" to match with the Date column in SharePoint because it's a record while the latter is date.

 

I would love to hear your response regarding my problem/question.

 

Regards,

Pete

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,142)