cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
leeanna
Level: Power Up

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
Super User

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
Super User

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

roxyshenton
Level: Powered On

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
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,434)