Open jnetode opened 1 year ago
I would like this feature too. It can be confusing when it starts to creep into the next working week!
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
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)
Your code threw up an error for me, so I altered to:
If(Text(ThisItem.date,DateTimeFormat.ShortDate) = Text(Today(),DateTimeFormat.ShortDate),1,0)
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!
@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) )
@digitisingsafety & @jnetode I am new to Power Apps. Can you show a screenshot of where i have to input the line of code in the OnVisible field?
@MattFuks I presume you mean to set the first day of the week to Monday? I inserted it directly under
Select(btnThisTeam);
@digitisingsafety & @jnetode I am new to Power Apps. Can you show a screenshot of where i have to input the line of code in the OnVisible field?
Sorry, I was out for some time. Here are the changes I did:
1) Set Monday as first day:
==> Screen "SplashScreen" Property "OnVisible"
from:
Set(
firstDate;
Today()
)
to:
Set(
firstDate;
DateAdd(
Today();
-(Weekday(
Today();
StartOfWeek.MondayZero
)
);
TimeUnit.Days
)
)
2) Set background color of current day:
==> Screen "Edit Presence and View Any Team" ==> Object "myCalendar1 Property "TemplateFill"
If(Text(ThisItem.date,DateTimeFormat.ShortDate) = Text(Today(),DateTimeFormat.ShortDate), RGBA(233, 234, 246, 1), RGBA(0, 0, 0, 0) )
==> Screen "Edit Presence and View Any Team" ==> Object "teamGallery1" ==> Object "gallIndividualCalendar_1 Property "TemplateFill"
If(Text(ThisItem.date,DateTimeFormat.ShortDate) = Text(Today(),DateTimeFormat.ShortDate), RGBA(233, 234, 246, 1), RGBA(0, 0, 0, 0) ) (note that I use UK English settings, you may need to change commas and semi-colons)
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