stuartridout / teamlink

TeamLink is a free Microsoft Teams Power App using Dataverse for Teams. It is a space where your team can share there whereabouts for the week ahead directly in Microsoft Teams. Users can select who they want to 'follow' and see the upcoming presences of or can view by site to see who is planning to be on site on that day. TeamLink allows you then to message to see if the person wants to meet up for a coffee ... all from the click of a button!
MIT License
51 stars 2 forks source link

Feature Request: My Calendar Weekly View #66

Open jnetode opened 11 months ago

jnetode commented 11 months ago

Hello, would it be possible to make a weekly view for the dates? Now the "My Calender" view starts today and show the next days. Since we strongly organize ourselfes in a weekly manner, it would be very helpfull to have a weekly view, starting always mondays and showing the entire week.

Thanks

digitisingsafety commented 9 months ago

I would like this feature too. It can be confusing when it starts to creep into the next working week!

digitisingsafety commented 9 months ago

I have added this feature to my own build by adding the following to the end of OnVisible for the Edit Presence and View Any Team screen:

Set(firstDate,DateAdd(Today(), -(Weekday(Today(),StartOfWeek.MondayZero)), TimeUnit.Days ));

This sets the first day as the Monday of the current week. You can find alternate code (e.g. if you want it to be a Tuesday, Wednesday, etc) here: http://powerappsguide.com/blog/post/get-dates-for-the-current-week

jnetode commented 9 months ago

Thanks a lot! That looks good. For the cherry in top of the cake, do you know how to set the current day background somehow different, just to show Today on the week days? That would be awesome!

Edit: I gave the day a border, so it helps seeing it. In the Edit Presence and View Any Team screen I have set the BorderWidth of the "lbDate_2": If( Text( ThisItem.date; DateTimeFormat.ShortDate ) = Text( Today(); DateTimeFormat.ShortDate ); 1; 0)

digitisingsafety commented 9 months ago

Your code threw up an error for me, so I altered to:

If(Text(ThisItem.date,DateTimeFormat.ShortDate) = Text(Today(),DateTimeFormat.ShortDate),1,0)

jnetode commented 9 months ago

Your code threw up an error for me, so I altered to:

If(Text(ThisItem.date,DateTimeFormat.ShortDate) = Text(Today(),DateTimeFormat.ShortDate),1,0)

That is because of regional settings. I cannot understand why on Earth MS does that, but as I understood, they respect the numeric regional settings. So I have to change commas and semi-colons in the code!

digitisingsafety commented 9 months ago

@jnetode I poached your code to alter the background color, which in my opinion has better visual impact.

On screen Edit Presence and View Any Team set TemplateFill of myCalendar_1 to:

If(Text(ThisItem.date,DateTimeFormat.ShortDate) = Text(Today(),DateTimeFormat.ShortDate), RGBA(233, 234, 246, 1), RGBA(0, 0, 0, 0) )

UPDATE: You can achieve the same for the team calendar, on the same screen, set TemplateFill of galIndividualCalendar_1 (nested within teamGallery_1) to:

If(Text(ThisItem.date,DateTimeFormat.ShortDate) = Text(Today(),DateTimeFormat.ShortDate), RGBA(233, 234, 246, 1), RGBA(0, 0, 0, 0) )