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

Display AM/PM along with Date on Calendar

Hello 

 

 

I have a Calendar as follows :

lovishsood1_0-1660712053492.png

 

As you can see, If a user applies for leave for a SINGLE DAY from Calendar for FULL DAY, It shows Full Day in Brackets

For half day, It will display Session 1 (AM). 

lovishsood1_1-1660712322016.png

 

Now, If I want to apply in RANGE ( Aug 30-Aug 31 -- FULL DAY), It will show as :

lovishsood1_2-1660712385869.png

 

Problem: If I apply in RANGE but I want to apply HAlf day for Aug 31... i.e., 1.5 Days
then it will display Session 1 (AM ) for both Aug 30 and Aug 31.

lovishsood1_3-1660712853597.png

 

 

Fields: This is how I'm applying for a Leave

From Date -- From Session (Session 1/Session 2) 

To Date -- To Session (Session 1/Session 2) 

 

 

Session 1 = AM 

Session 2 = PM

lovishsood1_5-1660713087613.png

 

 

 

My Code :

If(ThisItem.FromSession="Session 1" && ThisItem.ToSession="Session 2" ,"Full Day",
   ThisItem.FromSession="Session 1" && ThisItem.ToSession="Session 1" ,"Session 1",
   ThisItem.FromSession="Session 2" && ThisItem.ToSession="Session 2","Session 2")

 

 

Required Output :

 

Aug 30 (Full Day) and Aug 31 (Session 1)

 

 

I hope my problem is understood. 

2 REPLIES 2
VJR
Super User
Super User

But in your formula nowhere it is calculating based on the dates. It is only seeing the session dropdowns.

 

Therefore this formula (or any other) is always evaluating to Session 1 irrespective of what the dates are selected.

ThisItem.FromSession="Session 1" && ThisItem.ToSession="Session 1" ,"Session 1",

 

So need to work out on a logic to include dates too.

 

Yeah, I'm not able to figure that logic.

Can you help me in including dates along with sessions? 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,370)