cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Leave Request Flow - All Day Calendar Option

Hello,

 

SharePoint & Flow newbie here.

 

I created a simple leave request using a list and calendar. Once the manager approves the request, the date/time is posted on a shared calendar.

 

Question: Is there a way to implement an additional "All Day" option that will then post the date as All Day in the calendar? I want employees to have the option to input a time if they are taking a few hours off or check off All Day if they are taking a full day off.

 

Thanks in advance for any help!

 

PTOrequest.PNGPTOflow.PNG

 

 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Leave Request Flow - All Day Calendar Option

This is a configuration you would need to make on the SharePoint Calendar, which is SharePoint List - and not Flow. You'll need to leverage some JavaScript on the List to enable the all-day toggle default. Example code:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("ready");
function ready()
{
  // checks All Day Event
    if (!$('span[title="All Day Event"] > input').attr("checked"))
    {
    $('span[title="All Day Event"] > input').click();
    }
  //hide check-box
  $('tr:has(span[title="All Day Event"])').not('tr:has(tr)').hide();
  //$('nobr:contains("All Day Event")').closest('tr').hide();
}
</script>

See the full steps and details at Calendar make all events All Day events.

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

2 REPLIES 2
Highlighted
Super User II
Super User II

Re: Leave Request Flow - All Day Calendar Option

This is a configuration you would need to make on the SharePoint Calendar, which is SharePoint List - and not Flow. You'll need to leverage some JavaScript on the List to enable the all-day toggle default. Example code:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("ready");
function ready()
{
  // checks All Day Event
    if (!$('span[title="All Day Event"] > input').attr("checked"))
    {
    $('span[title="All Day Event"] > input').click();
    }
  //hide check-box
  $('tr:has(span[title="All Day Event"])').not('tr:has(tr)').hide();
  //$('nobr:contains("All Day Event")').closest('tr').hide();
}
</script>

See the full steps and details at Calendar make all events All Day events.

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

Highlighted
Helper I
Helper I

Re: Leave Request Flow - All Day Calendar Option

Hi @Brad_Groux,

 

Do you have any other links for the full code. I really need this for my Leave Calendar. Thanks!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,658)