Skip to content

Instantly share code, notes, and snippets.

@mhamzas
Created July 6, 2020 19:24
Show Gist options
  • Select an option

  • Save mhamzas/6adc9a1e0d6f006977f2ecd50fcb70aa to your computer and use it in GitHub Desktop.

Select an option

Save mhamzas/6adc9a1e0d6f006977f2ecd50fcb70aa to your computer and use it in GitHub Desktop.
ADDEVENT - Add to Calendar Button for Flow Screen - Lightning Component [AURA]
<aura:component implements="lightning:availableForFlowScreens" access="global" >
<aura:attribute name="showBtn" type="Boolean" default="false" />
<aura:attribute name="start" type="String" default="07/20/2020 08:00 AM" />
<aura:attribute name="end" type="String" default="07/20/2020 10:00 AM" />
<aura:attribute name="timezone" type="String" default="America/Los_Angeles" />
<aura:attribute name="title" type="String" default="Summary of the event" />
<aura:attribute name="description" type="String" default="Description of the event" />
<aura:attribute name="location" type="String" default="Location of the event" />
<ltng:require scripts="https://addevent.com/libs/atc/1.6.1/atc.min.js" afterScriptsLoaded="{!c.init}" />
<aura:renderIf isTrue="{!v.showBtn}">
<div class="slds-align_absolute-center">
<!-- Button code -->
<div title="Add to Calendar" class="addeventatc">
Add to Calendar
<span class="start">{!v.start}</span>
<span class="end">{!v.end}</span>
<span class="timezone">{!v.timezone}</span>
<span class="title">{!v.title}</span>
<span class="description">{!v.description}</span>
<span class="location">{!v.location}</span>
</div>
</div>
</aura:renderIf>
</aura:component>
<design:component>
<design:attribute name="start" label="start" default="07/20/2020 08:00 AM" />
<design:attribute name="end" label="end" default="07/20/2020 10:00 AM" />
<design:attribute name="timezone" label="timezone" default="America/Los_Angeles" />
<design:attribute name="title" label="title" default="Summary of the event" />
<design:attribute name="description" label="description" default="Description of the event" />
<design:attribute name="location" label="location" default="Location of the event" />
</design:component>
({
init : function(component, event, helper) {
component.set('v.showBtn', true);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment